Using MongoImport to bulk upload json data


One of the scenarios which comes quite often is to bulk upload data into tables and when it comes to DocumentDB like MongoDB , it’s uploading json data to a collection. Before you execute the command the pre-requisite is that you have installed MongoDB from here .

Once installed , you can find all the executables in the bin folder where MongoDB is installed.

C:\Program Files\MongoDB\Server\3.0\bin


one of the executables here is MongoImport , which is used for importing bulk data to a mongodb collection.

Open command prompt, and navigate to the bin folder of your mongodb installation and execute the below command.

/db:test test is the name of my MongoDB database
/collection:docsdocs is the name of the collection inside test db
C:\test\bulk_data.jsonlocation of the json file