How to export all collections in MongoDB?

前端 未结 28 1595
你的背包
你的背包 2020-11-29 14:32

I want to export all collections in MongoDB by the command:

mongoexport -d dbname -o Mongo.json

The result is:
No collection specifie

28条回答
  •  不知归路
    2020-11-29 15:03

    Exporting all collections using mongodump use the following command

    mongodump -d database_name -o directory_to_store_dumps

    To restore use this command

    mongorestore -d database_name directory_backup_where_mongodb_tobe_restored
    

提交回复
热议问题