How do I create a MongoDB dump of my database?

前端 未结 19 2465
既然无缘
既然无缘 2020-12-22 15:06

What command do I use and run?

19条回答
  •  伪装坚强ぢ
    2020-12-22 15:58

    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
    

提交回复
热议问题