MongoDB on Windows in 5 Minutes
Join the DZone community and get the full member experience.Join For Free
in this 5 minute post, we will describe a quick start for mongodb on windows. i will show you how to connect to mongodb server and to start the administrative shell.
first you need to download 64 bit binaries for windows 64 bit from here . after downloading unzip downloaded zip file at any location of your choice. after extracting, rename the folder to mongodb
next navigate to folder in which you unzipped the downloaded binaries. you will get the executable file below downloaded.
most important exe are mongod.exe to connect to mongo database server and mongo.exe to start administrative shell.
by default mongodb creates database and store data in
data folder inside c drive. you need to create this folder manually. you
need to create them as below,
you can connect to mongodb server as below by executing mongod exe
once server is started, you can start administrative shell as below by executing mongo command.
from administrative shell if you want to add two numbers, you can do that as below,
by default, it connects to database test
if you want to insert data you can do that as below, below command will create a database called debugmode [only when first row is inserting] and then add name as dj.
you can explore help option to know more about the executable and commands. in future articles we will go deeper on same and explore working with mongodb and csharp.
i hope this post is useful. thanks for reading
Opinions expressed by DZone contributors are their own.