How to export all collections in MongoDB?

前端 未结 28 1611
你的背包
你的背包 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 14:53

    you can create zip file by using following command .It will create zip file of database {dbname} provided.You can later import the following zip file in you mongo DB.

    Window filepath=C:\Users\Username\mongo 
    
    mongodump --archive={filepath}\+{filename}.gz --gzip --db {dbname}
    

提交回复
热议问题