In this recipe, you will see how to define a schema and perform CRUD operation on the database collection. First, ensure that you have MongoDB installed and it's running. As an alternative, if you prefer, a MongoDB DBaaS (Database as a Service) instance in the cloud will also do. Before you start, create a new package.json file with the following code:
{ "dependencies": { "mongoose": "5.0.11" } }
Then, install the dependencies by opening a Terminal and running this code:
npm install