Created
November 16, 2017 08:58
-
-
Save mamun67/35e28291bcf88861cd0bb165a4626fb5 to your computer and use it in GitHub Desktop.
MongoDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment