DEV Community

Discussion on: Mongodb-native over mongoose?

Collapse
 
perrydbucs profile image
Perry Donham

I promote Mongoose in my courses as a design tool. Abstraction is often used as a contract, and with a Mongoose schema I can create and enforce the contract for the interface into the database. The schema also helps me think about the structure of the data and its relationships.

If the app had a requirement for storing arbitrary objects I'd probably just use mongoDB without the Mongoose abstraction, but in my experience that sort of requirement is pretty rare.

Collapse
 
tojacob profile image
Jacob Samuel G.

I see, thanks for sharing your comments!

Collapse
 
yentsun profile image
Max Korinets

MongoDB had native schema validation since 3.2 (2015) but who cares - everybody promotes Mongoose in their courses.