What is MongoDB?

MongoDB is a free open source, cross-platform database. Classified as a NoSQL database. It’s a document oriented database program, in which each database contains collections and collections contain documents. Each document can be different in terms of the number of fields and size of the content. MongoDB replaces the old table structure relational database by JSON-like documents with dynamic schemas, it makes the integration of data in various types of applications faster and easier.

In this post, we are going to setup MongoDB on our Windows machine and then start with some basic queries. First, you have to download MongoDB from the official website

Once the download has finished double click on installer

And Click Next

After selecting the check box click next

Choose the complete installation

The setup is now ready to install MongoDB on your machine, click install Once the installation is completed the installation window must be closed if not close it. Now it’s time to setup the PATH environment variable for MongoDB. To do this press windows key and search System then hit enter, now select Advanced System Settings from the left pane. A mini System properties windows is now popped,

Click on Environment Variables , Now from the Environment Variables window select the Path under System variable section and click edit

Now a tiny window is popped, simply click New and paste this line C:Program FilesMongoDBServer3.4bin

NOTE: Depending on the version of your MongoDB, mine is 3.4 change it with yours if it different from my mine.And click ok, now close all pop-ups and restart your PC.

Verify MongoDB installation

To verify MongoDB installation open command prompt or any other terminal and type mongod , now MongoDB shell must be running and waiting for the connections.

To initiate a new instance of connection to MongoDB shell, open a new command prompt window and type mongo.

Congrats you have just initiated a new connection to MongoDB shell.Now you can run MongoDB queries on this window or connect your application with it.NOTE: The mongod cmd window must not be closed in order to work with MongoDB or the new mongo cmd window.


− How to show all databases

show dbs

− How to use a database

use databaseName

− How to show all collections from a database

show collections (only when switched to a database)

− How to insert a new data into an existing collection or made a new collection?

db.myCollection.insert({name:”Zubeen”, subject:”Database”})

− How to show/retrieve all data from the collections?


− How to find a particular entry from a collection?


− How to update a instance/document in a collection?


− How to remove an entry?

db.myCollection.remove({name:”Zubeen”}) /// It will remove all the persons that matches the name Zubeen

− How to remove a single entry which has duplicates?


If you want to learn more check out the official documentation

If you like this post, don’t forget to share 🙂

This article is written by our awesome writer
Do you like Zubeen's articles?  Follow on social!
Comments to: How to get Started with MongoDb on Windows

Your email address will not be published. Required fields are marked *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

New Dark Mode Is Here

Sign In to access the new Dark Mode reading option.

Join our Newsletter

Get our monthly recap with the latest news, articles and resources.

By subscribing you agree to our Privacy Policy.

Latest Articles

Explore Tutorials By Categories


Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones, if you have any suggestions, questions, bugs issue or any other queries you can simply reach us via the contact page


Welcome to Codeverb

Ready to learn something new?
Join Codeverb!

Read Smart, Save Time
    Strength indicator
    Log In | Lost Password