How to Install MongoImport and MongoExport

How to Install MongoImport and MongoExport

In this article, I am going to discuss How to Install MongoImport and MongoExport. Please read our previous article where we discussed How to work with MongoDB Database i.e. how to Show, Create, and Drop MongoDB Database.

How to Install MongoImport and MongoExport

MongoDB provides special tools to import/export data in/from MongoDB and the tools are MongoImport and MongoExport. In this article, I will show you how to install MongoImport and MongoExport tools.

What is MongoImport?

The MongoImport tool is used to import data in the MongoDB Database. With the help of MongoImport, we can import files like JSON, CSV, TSV, etc. into the MongoDB Database.

What is MongoExport?

The MongoExport tool is used to export data from the MongoDB database so that other applications can also use that data. With the help of MongoExport, we can import files like JSON, CSV, etc. from the MongoDB Database.

In earlier versions, MongoImport and MongoExport are available with MongoDB Server. But now they are available separately so you can download them according to your requirements.

Note: Always remember that MongoImport and MongoExport do not run in Mongo Shell. You can directly use them in command prompt (Windows) or terminal (macOS).

Installing MongoImport and MongoExport

Following are the steps to install MongoImport and MongoExport:

Step 1: Open the browser and go the like: https://www.mongodb.com/try/download/database-tools2

Step 2: Go to “MongoDB Command Line Database Tools Download”.

Installing MongoImport and MongoExport

Now you can choose the version, platform, and package. Here I choose version: 100.6.0, platform: macOS, Package: zip.

Step 3: After downloading unzip the file.

Installing MongoImport and MongoExport

Step 4: Now go to the bin folder of the unzipped file and copy all the .exe files.

How to Install MongoImport and MongoExport

Step 5: Paste all the copied .exe files into the MongoDB bin folder.

How to Install MongoImport and MongoExport

So, we get all the files in the MongoDB folder:

How to Install MongoImport and MongoExport

Step 6: Open a terminal and run the MongoDB server.

How to Install MongoImport and MongoExport

Step 7: Open another terminal and run mongoshell.

How to Install MongoImport and MongoExport

Step 8: Open one more terminal and run the following command to check MongoImport is successfully installed by checking its version- mongoimport –version

How to Install MongoImport and MongoExport

Step 9: Run the following command to check MongoExport is successfully installed by checking its version- mongoexport –version

How to Install MongoImport and MongoExport

Note: In Mac, you can directly access them but in windows OS, you have to redirect to the MongoDB bin folder. Now you are ready to use MongoImport and MongoExport.

In the next article, I am going to discuss How to Perform CRUD Operations in MongoDB with Examples. In this article, I try to explain How to Install MongoImport and MongoExport. I hope you enjoy this How to Install MongoImport and MongoExport article.

Leave a Reply

Your email address will not be published. Required fields are marked *