How to export all collections in MongoDB?

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

    1. Open the Connection
    2. Start the server
    3. open new Command prompt

    Export:

    mongo/bin> mongoexport -d webmitta -c domain -o domain-k.json

    Import:

    mongoimport -d dbname -c newCollecionname --file domain-k.json

    Where

    webmitta(db name)
    domain(Collection Name)
    domain-k.json(output file name)
    

提交回复
热议问题