intermediate
Mongoose
Use Mongoose schemas, models, validation, middleware, and population without losing sight of MongoDB document design.
Mongoose interviews focus on MongoDB document modeling with schemas, models, validation, middleware, and population—not relational habits copied into documents.
Subtopics: schemas, models, validation, middleware, population.
On interviews: explain embedding versus referencing for an aggregate, when lean queries matter, and how population affects query count.
Common pitfalls: unbounded document growth; hidden queries in hooks and populate; unique validators without indexes.
The trade-off is Mongoose convenience versus explicit MongoDB access-path design.
Checklist:
- Design documents around aggregate ownership.
- Separate API validation from schema rules.
- Watch query count on read paths.
- Prefer embedding when data is read together.