Skip to content

Instantly share code, notes, and snippets.

@vijaydeepak-tt
Created November 17, 2017 17:20
Show Gist options
  • Save vijaydeepak-tt/fe5762a48e4eba53cb48a89cba614638 to your computer and use it in GitHub Desktop.
Save vijaydeepak-tt/fe5762a48e4eba53cb48a89cba614638 to your computer and use it in GitHub Desktop.
mongod --dbpath "local db path(EX: F:\mongoDataBase\data)" ---> setting th db path in our local system.
mongo ---> starts the db.
mongodump ---> it will backups the database, inside the bin folder inside the dump folder.
mongorestore ---> restores all the backuped datas.
mongodump --db dbName ---> backups selected database.
mongorestore --db dbName dump/dbName ---> restores selected db.
mongodump --db dbName --collection collectionName ---> backups selected collection.
mongorestore --db dbName --collection collectionName dump/collectionName/collectionName.bson ---> restore selected collection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment