• Register
0 votes
1.6k views

Problem :

I want Import the dummy JSON file into my MongoDB but facing below error.

I am unable to understand the below error and so can not find the suitable "simple English" explanation nowhere to understand it by myself, so if you have any solution please send it to me.

The error in detail as below:

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

2019-12-18T13:23:56.592+1200    error validating settings: only one positional argument is allowed

Tried running the OSX -: Mongod started -: Using the /data/db path and connected to my test "All good" -: but running mongoimport from the separate shell gave below

$ mongo --version MongoDB shell version: 3.2.8

$ mongoimport --jsonArray --collection some_data --file /path/path/data.json

$ mongoimport --jsonArray --collection some_data /path/path/data.json

7.5k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Try it as mentioned below by quoting your path

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

The error as given below

error validating settings: only one positional argument is allowed

usually comes from the fact that your path contains the space which results in the splitting of it into two separate arguments if you are not guarded it by surrounding quotes.

Also your path is ending with '...bank_data.json/bank_data.json' and not just one 'bank_data.json' this is also wrong.

38.6k points

Related questions

0 votes
1 answer 67 views
67 views
Problem: I need help in solving this issue: Error validating settings: incompatible options: --file and positional argument(s) .
asked Mar 15 Wafa Abu Yousef 6.1k points
0 votes
1 answer 10 views
10 views
Problem: Is there a possibility to resolve this issue : Error validating settings: only one positional argument is allowed?
asked Jun 19 Shima 126k points
1 vote
1 answer 18 views
18 views
Problem: I am making a thread but I am getting this error. Passing argument 3 of ‘pthread_create’ from incompatible pointer type.
asked Mar 30 PkGuy 25.9k points
0 votes
1 answer 37 views
37 views
Problem: How to solve the following issue>command line error d8016: '/zi' and '/gy-' command-line options are incompatible?
asked Apr 8 ashik 14.6k points
0 votes
1 answer 26 views
26 views
Problem: Can anyone help with this? > /zi' and '/gy-' command-line options are incompatible.
asked May 15 Aurelia Maja 78.4k points
0 votes
1 answer 1.1k views
0 votes
1 answer 4 views
4 views
Problem: Cannot remove read-only file system?
asked 2 days ago Nahil 128k points
0 votes
1 answer 4 views
4 views
Problem: Has anyone experienced this before : Attempted to create a lock file on a read-only directory: /data/db?
asked Jun 19 Shima 126k points
0 votes
1 answer 29 views
29 views
Problem: It’s a serious problem for me, can anyone help : App crashed waiting for file changes before starting
asked May 17 Sawyer Parviz 168k points
0 votes
1 answer 17 views
17 views
Problem: While restart mongodb server using below command. its showing error like : Failed to restart mongod.service: Unit mongod.service not found. sudo service mongod restart
asked Apr 24 anika11 32.2k points