Guest User

Untitled

a guest
Nov 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. To start MongoDB
  2. ->mongod --dbpath ../newdata //Path of the data folder
  3. //To show available Db
  4. ->show dbs
  5. //to create new db and use it
  6. ->use dbname //it will create the db if it doesnot exist
  7. //to use a particular db
  8. -> use dbname
  9. //to enter data into mongodb collection
  10. ->db.collectionname.save({"data1":"test1","data2":"test2"})
  11. //to find all record
  12. ->db.collectionname.find()
  13. //to import data into collection
  14. ->mongoimport --db User --collection employee --file C:\Users\pmandawa\Desk
  15. top\data.json
Add Comment
Please, Sign In to add comment