Mongoose is an ODM library that wraps around the MongoDB Node.js driver. It provides a schema-based solution to model data stored in the MongoDB database.
The chief benefits of using Mongoose are:
You can create a schema structure for you documents.
Objects/documents in the model can be validated.
Application data can by typecasted into the object model.
Business logic hooks can be applied using middleware.
Mongoose is in some ways a bit easier to use than the MongoDB Node.js native driver.
However, there are some downsides to using Mongoose as well:
You must provide a schema, which isn’t always the best option when MongoDB doesn’t require it.
It doesn’t seem to perform as well at certain operations, such as storing data, as the native driver does.
18.191.189.23