node.jsmongodbmongoosemongodb-nodejs-driver

pros and cons of using MongoDB Node.js driver over mongoose and vice versa


I am working on a web application project which uses node.js as a backend . So I am using the mongodb database for storing and creating records . When I went deep down into mongodb driver for node.js , Then i found that there are two official and very famous framework for interfering into monogdb database . MongoDB Node.js driver and Mongoose.

I want to know how are the advantages and dis-advantages of using MongoDB Node.js driver over mongoose and mongoose over MongoDB Node.js driver.


Solution

  • Mongoose is an ODM. It uses the driver for all queries and operations. If you need the functionality that Mongoose provides, use Mongoose, otherwise use the driver directly.