Big Data Hadoop & Spark

Steps to Setup MongoDB in Windows

MongoDB is a hot technology available today that is used in various real-time applications and is in great demand these days. In this post, let’s look at the steps to setup MongoDB in Windows. This post is focused at people who have some basic knowledge about software in.
Let’s begin by understanding what MongoDB is.

What is MongoDB?

MongoDB is an open-source document database and a leading NoSQL database. MongoDB is written in C++.
Now, let’s head on to the installation of MongoDB.

100% Free Course On Big Data Essentials

Subscribe to our blog and get access to this course ABSOLUTELY FREE.

Installing MongoDB on Windows

The following are the steps to install the MongoDB on windows:
Step1: Download the latest release of MongoDB
Make sure you get correct version of MongoDB depending upon your windows version. (Choose legacy)
For 64 bit, use this link to download -> https://www.mongodb.org/downloads

Step2: Extract the zip file.
Step3: Set up the MongoDB environment.
MongoDB requires a data directory to store all data. MongoDB’s default data directory path is\data\db. Create this folder using the following commands from a Command Prompt:
md \data\db
You can specify an alternate path for data files using the –dbpath option to mongod.exe.
For example:
C:\mongodb\bin\mongod.exe –dbpath d:\test\mongodb\data
If your path includes spaces, enclose the entire path in double quotes, like below:  C:\mongodb\bin\mongod.exe –dbpath “d:\test\mongo db data”
You can also specify the dbpath in a configuration file.

Step4: Start MongoDB.
To start MongoDB, run mongod.exe. You can do this by typing the below command in the Command Prompt:
C:\mongodb\bin\mongod.exe
This starts the main MongoDB database process. The waiting for connections message in the console output indicates that the mongod.exe process is running successfully.
Depending on the security level of your system, Windows may pop up a Security Alert dialog box about blocking some features of C:\mongodb\bin\mongod.exe from communicating on networks. All users should select private networks, such as my home or work network and click ‘Allow access’. For additional information on security and MongoDB, please see the Security Documentation.

Step5:  Connect to MongoDB.
To connect to MongoDB through the mongo.exe shell, open another Command Prompt and type the following:
C:\mongodb\bin\mongo.exe
If you want to develop applications using .NET, see the documentation of C# and MongoDB for more information.
Step6: Begin using MongoDB.
To help you start using MongoDB, MongoDB provides ‘Getting Started’ guides in various driver editions. Before deploying MongoDB in a production environment, consider the Production Notes document. Later on, to stop MongoDB, press Control + C in the terminal where the MongoDB instance is running.

Latest Version of MongoDB

MongoDB 3.0.8
MongoDB 3.0.8 is out and is ready for production deployment. This release contains only fixes since 3.0.7, and is a recommended upgrade for all 3.0 users.
This release candidate includes a critical fix for SERVER-21275: when using the WiredTiger storage engine, a race condition may prevent locally committed documents from being immediately visible to subsequent read operations. This bug may have an impact on both server and application operations.
All MongoDB 3.0 users running (or wishing to run with) the WiredTiger storage engine should upgrade to 3.0.8.

Conclusion

MongoDB is a cross-platform, document oriented database that provides high performance, high availability, and easy scalability. MongoDB has rapidly grown to become a popular database for web applications and is a perfect fit for Node.JS applications, letting you write JavaScript for the client, backend and database layer. Its schema-less nature is a better match to our constantly evolving data structures in web applications, and the integrated support for location queries is a bonus that’s hard to ignore.
MongoDB works on concept of collection and document. So now you can start installing MongoDB and work on it. If you have any queries feel free to write us at [email protected]
Keep visiting our site www.acadgild.com for more updates on Bigdata and other technologies. Click here to learn Bigdata Hadoop from our Expert Mentors
AngularJS course details

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Articles

Close
Close