• Register
0 votes
1k 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 170 views
1 vote
1 answer 234 views
234 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 1K views
1K 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
0 votes
1 answer 211 views
211 views
Problem: I have fundamental knowledge of node.js, mongodb and expressjs. Currently I am trying to use the expressjs only for a backend. I also want to store data into a mongodb using the express. All of my view part is completely done in zend. I do not need the view to be in ... is how I have tried to redirect it to index.js app.get("/index",function(req,res){ console.log("route to index"); });
asked Aug 13, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 4 views
4 views
Problem: I am trying to write a program for file transfer using sockets. The server end of the code is running fine. However, in the client side I get the following error Traceback (most recent call last): File "client.py", line 54, in <module> uploadFiles( ... usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 111] Connection refused
asked 1 day ago Mashhoodch 6.7k points
0 votes
0 answers 33 views
33 views
I have a dataframe of almost 120000 records as follows. Also I have a mongoDB collection which looks exacly same as below dataframe ItemID ParentID ItemRating ItemPrice Qty A1 ItemA1 0 12 100 A2 ItemA2 0 15 200 B1 ItemB1 0 20 300 B2 ItemB2 0 25 400 B3 ItemB3 0 30 ... PyMongo update_many method by setting upsert=true. but I am not sure how can I do that ? how should I write my filter condition ?
asked Sep 13, 2020 NguyenTram 1k points
0 votes
1 answer 276 views
276 views
Problem: I am very new to php, mongodb and codeigniter. At this moment I am trying to connect the mongodb with the php codeigniter framework. I have already made changes in &ldquo;php.in file extension=php_mongodb.dll.&rdquo; I have also put that file in xampp/php/ext/ ... to MongoDB? Please Note: Currently I am using the php 7, xampp and mongo db is installed in my machine the 3.4 version.
asked Sep 3, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 55 views
55 views
Problem: I am the beginner to MongoDB. I had followed all the steps which are mention in MongoDB installation documents for the Ubuntu 16.04. I executed the following command: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv ... when I started my MongoDB then encountered an error as below: Failed to start mongod.service: Unit mongod.service not found.
asked Jul 29, 2020 Raphael Pacheco 4.9k points
2 votes
1 answer 430 views
430 views
Problem : I am very new to Mongodb, I am facing below error if I try to run the Mongodb. I had installed it with the help of Homebrew. Stewarts-MacBook-Pro:~ stewart$ mongod 2020-05-05T15:31:15.911+0700 I CONTROL  [initandlisten] MongoDB starting : pid ... +0700 I CONTROL  [initandlisten] shutting down with code:48 Stewarts -MacBook-Pro:~ stewart $ Kindly help me in resolving above Mongodb error.
asked May 6, 2020 stewart 4k points
0 votes
1 answer 403 views
403 views
Problem : I am trying to do the file upload & enter the data task into my MongoDB using a flask but I had below error when I filled my form & upload my image: &ldquo;Bad Request The browser (or proxy) sent a request that this server could ... mypassword, 'email': myemail, 'img_name': file_name})         return render_template('index.html')     else:         return render_template('index.html')
asked Jan 22, 2020 jwilliam 3.9k points