I’m trying to import some json data into Mongo and keep getting an error. I’m doing the import like this
mongoimport --stopOnError --db s --collection names < snow.json
The error it’s giving me is
Failure parsing JSON string near: ,
exception:BSON representation of supplied JSON is too large: Failure parsing JSON string near: ,
this is the json data. There’s actually more (about 9) entries, but i get the error even when there’s two. I copied this format from another json file that I was able to import. Running it through the json validator says
Expecting 'EOF', '}', ',', ']'
around the end of the first entry, but it says the same thing for the file I imported successfully too. Can you tell me what’s wrong?
{ "firstname" : "Dave", "initial" : "M", "lastname" : "Smore", "firm" : "", "address" : "PO Box 479, Vancouver BC V1L 5R3",
"email" : "david@smore.ca", "phone" : "(250) 654-6840" , "fax" : "(456) 987-7370", "sex": "m"}
{ "firstname" : "Kerry", "initial" : "C", "lastname" : "Amber", "firm" : "K Amber Corporation",
"address" : "980 5th Ave, Snowbank, BC V2L 3H8", "email" : "kamber@gmail.com", "phone" : "604 622 6156" , "fax" : "604 662-4532", "sex": "f"}
Thanks to the comment by @attish, the import worked after I removed line breaks from the json file.