I'm new to MongoDB in Windows 7 and I tried to import JSON and CSV file into MongoDB.
1.First i tried importing JSON file using the command
"C:\>mongodb\bin\mongoimport –host localhost:27017 –db mydb –collection docs"
and it showed this error
"exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Expecting '{': offset:0"
2.When i import CSV file i used the command
"C:\mongodb\bin>mongoimport --db mynewdb --collection message --type csv --fields
form,Iname,fistname,lastname --file d:\new folder\csv1.csv"
and i get the error message as
"ERROR: multiple occurrences
Import CSV, TSV or JSON data into MongoDB.
When importing JSON documents, each document must be a separate line of the input file"
I downloaded JSON and CSV bulk file randomly by browsing. I want to know whether it will get imported when data's are non-organized or should the data be organized? If so where can get a complete bulk JSON and CSV file which is ready to import.
尝试在查询结束时使用 --jsonArray 标志,这样它看起来像
C:\>mongodb\bin\mongoimport –host localhost:27017 –db mydb –collection docs --jsonArray
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.