How to run MongoDB
step1:- open your command prompt with "run as admin"
step2:- then type cd c:\program files\mongodb\server\3.0\bin
(mongodb default location in c: drive, using above command we going to access) if you are using earlier version 2.0,2.6 means you should follow cd c:\program files\mongodb 2.6 standard\bin
step3:- now you were inside mongodb file location, nxt is to create one new directory using command mkdir data.
step4:- type mongod --dbpath data (it will connect to port)
step5:- minimize the current command prompt and open another command prompt with "run as admin"
step6:- then type cd c:\program files\mongodb\server\3.0\bin
step7:- now type mongo localhost/pcat (connect to db server)
step8:- after connecting to db server try to insert a new collection/record by following query db.sample.insert({id:1,name:ram}) here sample is a collection name and inserting two
"show collections" command is use to display the existing collection in db server
"help" for help
"show dbs" command display schema
Next
« Prev Post
« Prev Post
Previous
Next Post »
Next Post »
Subscribe to:
Post Comments (Atom)
ConversionConversion EmoticonEmoticon