Understanding Mongoose

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:

Image You can create a schema structure for you documents.

Image Objects/documents in the model can be validated.

Image Application data can by typecasted into the object model.

Image Business logic hooks can be applied using middleware.

Image 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:

Image You must provide a schema, which isn’t always the best option when MongoDB doesn’t require it.

Image It doesn’t seem to perform as well at certain operations, such as storing data, as the native driver does.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.23.214