Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda