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.
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.
mongoimport /jsonArray /db:test /collection:docs <C:\test\bulk_data.json
|/db:test||test is the name of my MongoDB database|
|/collection:docs||docs is the name of the collection inside test db|
|C:\test\bulk_data.json||location of the json file|