What does “too many positional options” mean when doing a mongoexport?

后端 未结 14 1670
暖寄归人
暖寄归人 2020-12-05 09:27

mongoexport -h db.mysite.com -u myUser -p myPass -c myCollection

But the response I get is:

ERROR: too many positional options

14条回答
  •  暖寄归人
    2020-12-05 10:17

    I had the same issue with mongodump. After searching a bit, I found out that using the --out parameter to specify the output directory would solve this issue. The syntax for using the out parameter is

    mongoexport --collection collection --out collection.json
    

    Also in case your Mongodb instance isn't running, then you could use the --dbpath to specify the exact path to the files of your instance.

    Source: http://docs.mongodb.org/manual/core/import-export/

提交回复
热议问题