Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To start MongoDB
- ->mongod --dbpath ../newdata //Path of the data folder
- //To show available Db
- ->show dbs
- //to create new db and use it
- ->use dbname //it will create the db if it doesnot exist
- //to use a particular db
- -> use dbname
- //to enter data into mongodb collection
- ->db.collectionname.save({"data1":"test1","data2":"test2"})
- //to find all record
- ->db.collectionname.find()
- //to import data into collection
- ->mongoimport --db User --collection employee --file C:\Users\pmandawa\Desk
- top\data.json
Add Comment
Please, Sign In to add comment