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

Kevin Meredith picture Kevin Meredith · Sep 4, 2013 · Viewed 10.4k times · Source

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.

Answer

Sunny Sharma picture Sunny Sharma · Jan 8, 2014

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!!