How do I create a MongoDB dump of my database?

TIMEX picture TIMEX · Feb 2, 2011 · Viewed 236.8k times · Source

What command do I use and run?

Answer

saimadhu.polamuri picture saimadhu.polamuri · Apr 1, 2015

To dump your database for backup you call this command on your terminal

mongodump --db database_name --collection collection_name

To import your backup file to mongodb you can use the following command on your terminal

mongorestore --db database_name path_to_bson_file