Lab / MongoDB

Mongo DB install

Today we'll trying to instal MongoDb most easy way and create first database

1 step

most quickly with this command:

mkdir data/db -p

2 Step

Now we'll start MongoDB

- Go to the "bin" folder and run $ mongod process with our path parameter

cd bin

mongod --dbpath ../data/db

You'll have any time when the terminal will creating structure.

Then in new terminal tab start mongo shell. go to the folder mongo/bin, and run this command:

mongo

is this ok you'll have somthing like that:

MongoDB shell version 3.2.3
connecting to test

So. It's all now you have MongoDB installed. Look 127.0.0.1:27017 - should be this message:

"It looks like you are trying to access MongoDB over HTTP on the native driver port.

Ok, now we'll speak about basic use the MongoDB

Mongo Shell commands