Quiz: Mongoose
Test your understanding of Mongoose schemas, models, validation rules, middleware, default values, and database integration in Node.js applications.
We'll cover the following...
We'll cover the following...
Quiz
1.
In a MERN API using raw MongoDB driver code, what is a primary risk when each controller implements its own field validation and default setting?
A.
Accumulation of inconsistent document shapes across the collection, causing runtime errors or broken UI components
B.
Automatic enforcement of MongoDB schema constraints leads to duplication of validation logic
C.
MongoDB prevents any mismatched fields from being stored, so no validation is needed in controllers
D.
Controllers always ensure that all fields are strictly validated, thus preventing data drift
1 / 13
...