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

132
Visualizações
How to get mongoose model have an array field that other Mongoose document's can be referenced in?

I am working on a web app to create, organize and quickly use your code snippets, with plans of VS Code integration to sync snippets to your snippets json files.

I have two mongoose models, one called "groups" and one called "snippets". A user can create a snippet just fine, but now I want to make the groups model act as a way to group multiple snippets together. So one of the fields in the collections model is an array that defaults to an empty array.

So now to get to the point. I need that snippets array contain actual references to a document in the snippets collection. This way it can be dynamic and let me do things such as going to delete the snippet only, and now a groups document automatically removes the reference from the array.

about 4 years ago · Juan Pablo Isaza
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