Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

mongodb

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

But the response I get is:

ERROR: too many positional options

What's that about?

like image 597
Aarvind Avatar asked Sep 22 '11 20:09

Aarvind


2 Answers

I had this same problem. In my case, I was using mongoexport with the --query option, which expects a JSON document, such as:

mongoexport ... --query {field: 'value'} ... 

I needed to surround the document with quotes:

mongoexport ... --query "{field: 'value'}" ... 
like image 97
Dean Langford Avatar answered Sep 19 '22 19:09

Dean Langford


I had the same problem. Found a group post somewhere which said to remove the space between the '-p' and the password, which worked for me.

Your sample command should be:

mongoexport -h db.mysite.com -u myUser -pmyPass -c myCollection 
like image 24
rowanu Avatar answered Sep 20 '22 19:09

rowanu