Before we dive headlong into working with MongoDB in our Express web server, let's cover the basics of how to set up MongoDB and create a simple database using the MongoDB mongod process and the mongo shell. After we create our database, we will write a simple test record to the database to explore what writing data to MongoDB looks like. One of the unique aspects of MongoDB is its ability to read and write values natively in the JSON format. This makes working with MongoDB data through tools like Mongoose very easy, as we will see in-depth in further sections.
How to set up and create a MongoDB database
Getting ready
We need to install MongoDB locally to use it in our application. The MongoDB team provides extensive...