• Register
0 votes
1.2k 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

6 5 3
7,540 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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 13 views
13 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
1 vote
1 answer 2 views
2 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 13.1k points
0 votes
1 answer 2 views
2 views
Problem: How to solve the following issue>command line error d8016: '/zi' and '/gy-' command-line options are incompatible?
asked 4 days ago ashik 11.2k points
0 votes
1 answer 609 views
0 votes
1 answer 2 views
2 views
Problem: Please help me fix this dilemma: could not open lock file /var/lib/dpkg/lock.
asked 6 days ago tuhin1 48.4k points
0 votes
1 answer 8 views
8 views
Problem: Have anybody faced this error? any clues to fix this error: Attempted to create a lock file on a read-only directory: /data/db, terminating
asked Mar 14 Wafa Abu Yousef 6.1k points
1 vote
1 answer 374 views
374 views
Problem : I am very new to Node.js. I want to create a small application which uses the express and mongosse to store some of the users in my based cloud database i.e. mongoDB via mlab. Please find below MyUser.js (models/MyUser.js) var dbmongoose = require('mongoose'); ... hard from past few days to fix above error but I am still unable to fix it. I am looking for expert help to fix above error.
asked Apr 8, 2020 morrisBson 3.2k points
0 votes
1 answer 1.4K views
1.4K views
Problem : I had created /data/db in my root directory and ran ./mongod but getting below error : [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating [initandlisten] shutdown: going to ... .. [initandlisten] now exiting [initandlisten] shutting down with code:100 Have anybody faced above error? any clues to fix above error?
asked Jan 4, 2020 alecxe 7.5k points
1 vote
1 answer 12 views
12 views
Problem : I tried installing but that didn't work , Its throw this error : node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'mongoose' at Function._resolveFilename (module.js:334:11) at Function._load (module.js ... Function._load (module.js:310:12) at Module.require (module.js:357:17) Does anyone know what it is and how to solve it? Thanks
asked Mar 29 Shovo210 13.3k points
0 votes
1 answer 4 views
4 views
Problem: I need someone’s help to fix it. Mongoerror: e11000 duplicate key error collection:
asked Mar 21 Ifra 24.4k points