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

332
Views
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 answers
Answer question

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 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!