Setup

We will now try to get our hands dirty with some practical examples. But first we have to set up the environment.

Install MongoDB

You can download the database server from their official download page. Once it has downloaded, you can click on the file to run it and follow the instructions.

The file installs two different things. The first is the database server.This is the program which works with the actual data and the actual JSON files. This is the software which does all the indexing and searching of data.

The second software which was installed is called MongoDB Compass. This is a “client” which is used to connect to the database and display the data which is within the database in a nice way.

When prompted to connect to a database, keep everything as it is, and just click on connect. The following screen should appear.

Creating Data

Now that you have everything installed, you can create your first database by clicking on the bottom left “+” sign.

Then enter the name of your database as well the first collection of objects and click create database.

Feel free to create databases, collections, and documents as you want. Play around to get the hang of it. See if you can create the two student records as shown in the previous page.

Leave a comment

Design a site like this with WordPress.com
Get started