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

341
Vistas
Why mongoose.model() is required to get data from MongoDB?

I want to read data from the mongodb with mongoose, but every time it requires creating a model. Why? I thought model are just like templates to insert data to MongoDB. Can anyone describe what exactly mongoose.model() is and how it works?

I tried

const Model = mongoose.model(mongoose.Schima())

Without object in it And it worked as well!!!

How does mongoose.model get data in background?

Thank you...

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Mongoose models are much more than just templates on how to store data in the database: they perform type conversion, provide validation, have pre/post hooks, provide easy methods for population, and much more.

You don't need to use a full model to retrieve data from the database (in fact, you don't even need Mongoose at all), but you'll lose all the additional features.

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