Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda