Popular Posts

Tuesday, May 31, 2016

MongoDB tutorial with Java


MongoDB is the most popular No-SQL database. Lets try it out:

1) Install: 
Go to the MongoDb website and download latest release.

2) Run MongoDB:
First command prompt window:
C:\Program Files\MongoDB\Server\3.2\bin>mongod.exe --dbpath D:\mongo\data
Second command prompt window:
C:\Program Files\MongoDB\Server\3.2\bin>mongo.exe

2) Creating a Database: write insert queries
db.mytable.insert({
    first: 'amit',
    last: 'kumar',
    age: 25,
    dob: '21/04/1978',
    gender: 'm',
    occupation: 'developer',
    nationality: 'indian'
});
db.mytable.insert({
    first: 'sumit',
    last: 'singh',
    age: 34,
    dob: '26/03/1940',
    gender: 'm',
    occupation: 'engineer',
    nationality: 'american'
});

3) verify
db.mytable.find()


4) Download Robomongo
connect to database and see the records present there.


12 comments:

Maani kamili said...
This comment has been removed by a blog administrator.
Rajapriya R said...

useful blog to all

best java j2ee training | java training center in chennai | java training institute in chennai | java j2ee training center in chennai

Nancy 12 said...

I have read your blog its very attractive and impressive. I like it your blog. Java Training in Chennai

sunitha vishnu said...

This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Yasmin Priya said...

Hi, I am a big follower of your blog. Really very informative post you shared here. Keep sharing this type of informative blog. Waiting for your next update. If anyone wants to become a Java professional learn Java Training in Bangalore. Nowadays Java has tons of job opportunities for all professionals.

vignesjoseph said...

Thanks for mentioning a useful link to learn Java, I too like to suggest some useful links for your viewers. Java become the most trending web application front end tool where many companies looks for-
Selenium Training in Chennai
Java Training in Chennai

srihariparu said...

Hi, Really your post was very informative.


Web Designing Training Institute in Chennai | Dot Net Training Institute in Chennai
| Online Training Institute in Chennai

louis philip said...

This article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things...

Android App Development Company

john stany said...


I am expecting more interesting topics from you. And this was nice content and definitely it will be useful for many people.
iOS App Development Company
iOS App Development Company

Sharon Sandy said...

great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
web design Company
web development Company
web design Company in chennai
web development Company in chennai
web design Company in India
web development Company in India

louis philip said...

Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
Fitness SMS
Fitness Text
Salon SMS
Salon Text
Investor Relation SMS
Investor Relation Text

isabella jacob said...

it is really amazing...thanks for sharing....provide more useful information...
Mobile app development company