How to use mongodump for 1 collection

后端 未结 4 770
小蘑菇
小蘑菇 2021-01-30 00:58

How can I use mongodump to move a single collection from one database to another?

How should I use the command and its options?

4条回答
  •  遥遥无期
    2021-01-30 01:21

    Taking database (document) dump (backup)

    mongodump --host  --db  --username  --password  --gzip --out 
    

    Taking collection dump (backup)

    mongodump --host  --db  --collection  --username  --password  --gzip --out 
    

    mongodump documentation

提交回复
热议问题