Questions tagged [mongoimport]

The mongoimport utility provides a route to import content into MongoDb, from a JSON, CSV, or TSV export created by mongoexport, or potentially, another third-party export tool.

The mongoimport utility provides a route to import content into MongoDb, from a JSON, CSV, or TSV export created by mongoexport, or potentially, another third-party export tool. See the mongoDb documentation.

375 questions
213
votes
20 answers

Mongoimport of JSON file

I have a JSON file consisting of about 2000 records. Each record which will correspond to a document in the mongo database is formatted as…
amber4478
  • 6,433
  • 3
  • 20
  • 17
207
votes
23 answers

How to use mongoimport to import CSV files?

CSV file with contact information: Name,Address,City,State,ZIP Jane Doe,123 Main St,Whereverville,CA,90210 John Doe,555 Broadway Ave,New York,NY,10010 Running this doesn't add documents to the database: $ mongoimport -d mydb -c things --type…
Joe
  • 25,307
  • 12
  • 38
  • 35
52
votes
1 answer

MongoDB Atlas mongoimport issues cannot decode array into a D

I'm new to mongoDB and have a free Atlas account. But, I'm having issues with the mongo import. system: windows >mongo --version MongoDB shell version v4.2.0 git version: a4b751dcf51dd249c5865812b390cfd1c0129c30 allocator: tcmalloc modules:…
majortom84
  • 611
  • 1
  • 8
  • 16
41
votes
4 answers

How to import dumped Mongodb?

Dumped a MongoDB successfully: $ mongodump -h ourhost.com:portnumber -d db_name01 -u username -p I need to import or export it to a testserver and have struggle with it, please help me figure out. I tried some ways: $ mongoimport -h host.com:port…
YogiZoli
  • 870
  • 1
  • 9
  • 17
34
votes
4 answers

MongoDb: How to import dump data from .gz file?

I want to import dump data from my .gz file. Location of file is home/Alex/Documents/Abc/dump.gz and the name of db is "Alex". I have tried mongorestore --gzip --db "Alex" /home/Alex/Documents/Abc/dump.gz But it shows error: …
Chaitanya Parashar
  • 692
  • 2
  • 12
  • 21
31
votes
13 answers

Import more than 1 json file using mongoimport

I am new to mongodb and want to know about importing a json file from one server to another. I tried the following command mongoimport -d test -c bik check.json and it works fine for me. Now i want to know when there are multiple json files how do i…
user850234
  • 3,373
  • 15
  • 49
  • 83
29
votes
2 answers

Importing JSON file using mongimport, keep getting `unexpected identifier`?

I'm trying to add a JSON file to mongodb using mongoimports from terminal, here: mongoimport --db my_db --collection my_collection --file /content/2_read.json I keep getting JavaScript execution failed: SyntaxError: Unexpected identifier I ran my…
cathy.sasaki
  • 3,995
  • 6
  • 28
  • 39
19
votes
6 answers

Mongoimport json file update or overwritte ..?

I'm having DB which name is "Project" and collection which name is "sample" then I inserted one JSON file using mongoimport command. Now i edited the same JSON file. So if want to import the same JSON file to the Collection then I am facing the…
Mercer
  • 9,736
  • 30
  • 105
  • 170
18
votes
13 answers

`fields cannot be identical: ' ' and ' '` mongoimport error

i'm trying to import a csv into mongodb on my local machine. I used the following commmand from the shell: mongoimport -d mydb -c things --type csv --file /Users/..../agentsFullOutput.csv --headerline I get the following error: Failed: fields…
DBWeinstein
  • 8,605
  • 31
  • 73
  • 118
15
votes
7 answers

mongodb-error validating settings: only one positional argument is allowed

I just moved to a new laptop which had mongo 3.0.0 I believe. On the new laptop I have mongo 3.0.4. and trying the script that was working on the old laptop is giving me errors. This line is giving me the error. mongoimport --host localhost \ …
Roudy Tarabay
  • 449
  • 1
  • 4
  • 18
15
votes
2 answers

mongodbimport Failure - FailedToParse: Expecting '{': offset:0

I tried to import a 7.4 MB JSON file via ... mongoimport -d mongoimport -c test --file jsonTest.json But I saw this issue. Wed Sep 04 13:08:52.378 exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse:…
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
14
votes
3 answers

How to mongoimport in a remote server

I'm trying to create a simple website that displays a table based on a relatively small json data (>5MB). I plan on importing the json into MongoDB and performing queries using a driver (either Mongoose or PyMongo). As the data size is very small,…
chachacha
  • 328
  • 1
  • 2
  • 10
13
votes
13 answers

mongoimport json file syntax

I'm trying to import json document using mongoimport command and have tried all possible ways but it's giving be below error. Plz tell me what m I doing wrong here. I've given full path of json doc. I want to import big document having 800+ records…
Archana Mundaye
  • 523
  • 1
  • 5
  • 19
13
votes
4 answers

MongoDB Bulk import using mongoimport from Windows folder

I have a lot of json files in archive and i need to import them into mongo per one operation (i think that it might be in cycle). Have you any ideas about this?
user3306125
  • 215
  • 1
  • 4
  • 12
11
votes
5 answers

Importing Date-datatype using mongoimport

I have many GB of data stored in PostgreSQL database and i need those to be imported into the MongoDB. I did this using CSV export and mongoimport. There are columns like this '2011-06-25' in that CSV and it has been imported as string, not as…
Radek Simko
  • 15,886
  • 17
  • 69
  • 107
1
2 3
24 25