We did quickly review what Mongo queries look like in Chapter 1, Introduction to MEVN. Here, we will dive deep into these queries.
The first thing we need to do is start the MongoDB server. We can do that with this command:
$ mongod
Now, let's open the mongo shell by typing mongo in our Terminal. When we enter the mongo shell, to display the list of databases, we type show dbs.
If you see the database in the list, type use {database_name} to start using this database. If we haven't created our database yet, just using use {database_name} will create a database for us. It's as simple as that. For this exercise, let's create a database called mongo_test_queries. So for that, we need to use:
> use mongo_test_queries
This should output the following in the Terminal:
# switched to db mongo_test_queries
Now, once we enter the database, the first...