I assume that you already know that MongoDB is a NoSQL database system that stores data in the form of BSON documents. Your question, however, is about packages for Node.js.
From the point of view of Node.js, mongodb is a native driver for interacting with a mongodb instance, and mongoose is a tool for modeling objects for MongoDB.
Mongoose is built on top of the MongoDB driver to enable programmers to model their data.
EDIT: I don't want to comment on which is better, as that would make this answer self-confident. However, I will list some advantages and disadvantages of using both approaches.
Using Mongoose, a user can define a schema for documents in a specific collection. This provides great convenience in creating and managing data in MongoDB. On the other hand, the study of mongoose can take some time, and has some limitations in working with schemes, which are quite complex.
However, if your collection scheme is unpredictable, or you want to use a wrapper like Mongo in Node.js, then use the MongoDB driver. This is easiest to pick up. The disadvantage here is that you will have to write large amounts of code to verify the data, and the risk of errors is higher.
ZeMoon Feb 25 '15 at 6:06 2015-02-25 06:06
source share