Mongodb-error check settings: only one positional argument is allowed

I just switched to a new laptop with mongo 3.0.0. On the new laptop I have mongo 3.0.4. and trying a script that worked on an old laptop gives me errors. This line gives me an error.

mongoimport --host localhost \ -db roudy123_q \ -collection LebaneseAmericanUniversity\(Lebanon\).json \ --file LebaneseAmericanUniversity\(Lebanon\).json \ --jsonArray 

Error checking options: only one positional argument is allowed.

I was looking for a Google bug, and the only relevant result was the mongoimport source code. Therefore, I suppose this has something to do with the new version.

+9
source share
5 answers

Just a wild hunch ...

... but various long options should be specified with -- , not - :

 mongoimport --host localhost \ --db roudy123_q \ --collection LebaneseAmericanUniversity\(Lebanon\).json \ --file LebaneseAmericanUniversity\(Lebanon\).json \ --jsonArray 

Maybe this particular version of mongoimport more punctual and will refer to -db ... -collection ... as positional arguments, not keyword arguments?

+22
source

This error can also occur if white spaces are specified without a "\" in the file path. Example: This will not work: Error

But this would work:

works great

+4
source

If you get this error when inserting fields with fields, a probable reason could be the use of spaces for this.

Both -f and - fields should work in these cases. Using Mongo version 3.0.6

 mongoimport --db logs --collection action_logs --type tsv -f updated_at ,transaction_time ,origin --file parsed.tsv mongoimport --db logs --collection action_logs --type tsv -f updated_at,transaction_time,origin --file parsed.tsv 
0
source

I think that providing spaces in the directory file name will also contribute to this error.

0
source

I see that this is a very old topic. Can anyone help a newbie?

I am trying to import CSV into mongodb atlas, here is my import expression (sensitive data deleted :)

mongoimport --host ClusterXXXXXXXXXXXXXX --ssl - username XXXXXX --password XXXXXXXX --authenticationDatabase admin --db CRM --collection CRM --type csv --file accounts.csv --fields id, name, parent name, PID, PID, Type, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, Country Code, Phone, Fax, Website, Industry, AnnualRevenue, NumberOfEmployees, Ownership, TickerSymbol, Description, Rating, Website, CurrencyIsoCode, CreatedDate, LastModifiedCocc_State_Last, LastModifiedocc Focus_Region__c, Potential_Sponsor__c, Data_Source__c, Account_Type__c, Sector__c, PCI_Company_Type__c, Account_Description__c, Potential_Media_Partner__c, Closed_Down__c, Average_Opportunity_Ratio__c, Sponsored__Aventc_count_count_count_count

I RECEIVED THE FOLLOWING ERROR WHY I DO NOT UNDERSTAND WHY THERE ARE NOT SINGLE "-"

settings check error: only one positional argument is allowed

-1
source

All Articles