Is mongoimport recommended for bulk insertion of json files?

621 views
Skip to first unread message

bharath phatak

unread,
Mar 20, 2014, 3:38:13 AM3/20/14
to mongod...@googlegroups.com

Hi All,

I am new to mongodb and looking into how to insert the json files to mongodb.

Its seems mongoimport is a way to insert the json directly into mongodb. Does mongoimport have performance issues when compared with insert statements?

Which is  best way to insert json files?

Any help much appreciated.Correct me if my understanding is wrong. 

Thanks

Mirko Bonadei

unread,
Mar 20, 2014, 7:29:24 PM3/20/14
to mongod...@googlegroups.com
You can use it without problems but pay attenction to the format of the Json. 

Mirko

Eoin Brazil

unread,
Mar 31, 2014, 9:53:02 AM3/31/14
to mongod...@googlegroups.com
Hi Bharath,

What are you trying to achieve with the JSON import ?
How often do you need to insert this information (every few minutes, hours, daily, or what frequency do you need to import it) ?

You can insert JSON via your application directly or you can use the mongoimport tool, either approach will work. 

If you are doing it very frequently, it may be easier for your own workflow to use Bulk Inserts from your application rather than the mongoimport tool. You can run multiple instances of mongoimport to improve its performance as the tool is currently single threaded.

Bulk inserts are discussed in the docs here: http://docs.mongodb.org/manual/core/bulk-inserts/

Thanks!
Eoin
Reply all
Reply to author
Forward
0 new messages