mongoimport : 'error validating settings: only one positional argument is allowed'

Try it like that by quoting your path

$ mongoimport --jsonArray --collection bank_data '/Macintosh HD/Users/Tinus/Downloads/bank_data.json/bank_data.json'  

The error

error validating settings: only one positional argument is allowed

comes from the fact that your path contains a space which results in splitting it into two separate arguments (if not guarded by surrounding quotes)


BTW: Are your sure your path ends with '...bank_data.json/bank_data.json' and not just one 'bank_data.json'?


~Fix~

A) I changed the path to reed direct from a new folder on root B) For any other’s having the same issue on mac osx —leave out the base root in your path , in my example above it was [ Macintosh HD] the import works without specifying it. thus it was changed to ..

        $ mongoimport --jsonArray --collection bank_data '/Users/Tinus/Downloads/bank_data.json/bank_data.json'

C) Yes the quotes are essential and was also added… D) Remember not to run it inside the mongo shell.

thumbs Up again to DAXaholic