We have studied a handful of MongoDB queries for performing CRUD operations through the MongoDB Shell. Now we only need the MongoDB driver to help us to connect to the MongoDB server and perform the same CRUD operations that we did with the MongoDB Shell. We will install this driver in our app as a dependency in our server-side framework – Koa.
Installing the MongoDB driver
The official MongoDB driver is mongodb for Node.js apps. It is a high-level API, built on top of the MongoDB Core driver, mongodb-core, a low-level API. The former is made for end users, while the latter is made for MongoDB library developers. mongodb contains abstractions and helpers that make MongoDB connections, CRUD operations, and authentication easy, while mongodb-core only contains the basic management of MongoDB topology connections, core CRUD operations, and authentication.
For more information about these two packages, visit the following sites: