How to set up and create a MongoDB database
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.
Getting ready
We need to install MongoDB locally to use it in our application. The MongoDB team provides extensive documentation for installing MongoDB on every conceivable operating system and, often, with several examples of different ways to install based on your preferences for how you want MongoDB to run as a process.
You can visit the following link for more information on it: