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

后端 未结 14 1655
暖寄归人
暖寄归人 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:26

    This also works if you place the -c option first. For me, this order does work:

    mongoexport -c collection -h ds111111.mlab.com:11111 -u user -p pass -d mydb
    

    You can also leave the pass out and the server will ask you to enter the pass. This only works if the server supports SASL authentication (mlab does not for example).

    0 讨论(0)
  • 2020-12-05 10:27

    In my case, I had to write the port separately from the server connection. This worked for me:

    mongoexport --host=HOST --port=PORT --db=DB --collection=COLLECTION --out=OUTPUT.json -u USER -p PASS

    0 讨论(0)
提交回复
热议问题