Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
E11000 MongoDB Error occuring from a field which I deleted from Model

When creating users mongo throws E11000 error (E11000 duplicate key error collection: invent.users index: photo_1 dup key: { photo: null }"). I don't have the photo key anymore and deleted documents from the collection. Now, once I create the first user, I cannot create the second one. But if I delete that only one, I will be able to sign a user - but only 1 again.

So I'm wondering if there is a cache and a way to clear it because it seems that the problem comes with the photo key though I do not have it at all in my Model.

Someone says that Mongoose doesn't keep any cache, but what can it be that kept the field that doesn't exist anymore? I guess dropping the collection will resolve the problem, but this is not the best solution.

Thanks in advance!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I can't comment so I have to ask this way, have you set unique:true for this photo field? because if it is you need to go into your compass or atlas to delete the index for it. because mongo DB set an index for the unique key.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!