How to export all collections in MongoDB?

前端 未结 28 1531
你的背包
你的背包 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:08

    Previous answers explained it well, I am adding my answer to help in case you are dealing with a remote password protected database

    mongodump --host xx.xxx.xx.xx --port 27017 --db your_db_name --username your_user_name --password your_password --out /target/folder/path
    

提交回复
热议问题