Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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: Expecting '{': offset:0

This Stackoverflow post presented a similar issue with respect to the date occurring before Jan 1, 1970, but that doesn't seem to apply given my FailedToParse: Expecting '{': offset:0 error.

like image 656
Kevin Meredith Avatar asked Sep 04 '13 17:09

Kevin Meredith


1 Answers

seems I'm much late but with the correct answer:

add --jsonArray in your statement and it will work. It should read like:

mongoimport -d mongoimport -c test --file jsonTest.json --jsonArray

Cheers!!

like image 83
Sunny Sharma Avatar answered Sep 29 '22 18:09

Sunny Sharma