Re: mongoimport 2.2 busted

1,295 views
Skip to first unread message

Tad Marshall

unread,
Aug 30, 2012, 5:57:47 PM8/30/12
to mongod...@googlegroups.com
The lines with ??? are what a (new!) Windows stack trace looks like when you don't have a PDB file (and we didn't include one for mongoimport.exe).  We will try to make that more useful in the future ...

Your test fails for me the same way in Windows 2.2.0, Windows 2.0.7 and Linux 2.0.6, so it's not new and it's not Windows-specific.  I don't have personal experience using mongoimport, so I'll play with it and see if the file format is wrong or our code isn't working right.  I'll let you know what I learn ...

On Thursday, August 30, 2012 4:40:52 PM UTC-4, Geneo wrote:
New user to mongo and wanted to run queries against the json files we use on our project. I attempted to use the mongoimport tool and cannot successfully import any json file even a simple 3 parameter file.

{
        "AGING": 1, 
        "AIRPLANE_MIGRATION": 0, 
        "ANIMAL_RESERVOIR": 0
 }

I'm on 64 bit windows 7.

The first error I see is 

Thu Aug 30 13:29:25 Assertion: 10340:Failure parsing JSON string near:
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 mongoimport.exe    ???
Thu Aug 30 13:29:25 kernel32.dll       BaseThreadInitThunk+0xd
Thu Aug 30 13:29:25 exception:BSON representation of supplied JSON is too large: Failure parsing JSON string near:

This error then repeats for each parameter indicating a parser JSON string near: "parameter name"

Using the following cmd line syntax
d:\mongodb\bin\mongoimport.exe -d test -c testDTK d:\mongodb\jsons\glossary.json


Wes Freeman

unread,
Aug 30, 2012, 6:06:39 PM8/30/12
to mongod...@googlegroups.com
This will happen if your JSON objects in the import are spanning multiple lines. If you can easily massage your data to be all on one line, that's probably the best way to resolve this:

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Geneo

unread,
Aug 30, 2012, 6:50:48 PM8/30/12
to mongod...@googlegroups.com
Thanks for the reply. I removed all the records from the json files and put the entire parameter set on one record and it works.

For now I'm happy and do appreciate the responses!

Tad Marshall

unread,
Aug 30, 2012, 9:15:00 PM8/30/12
to mongod...@googlegroups.com
Thanks, Wes, for the answer and for the the link to the documentation.  "The import file should contain one document per line" makes it pretty clear :)
Reply all
Reply to author
Forward
0 new messages