Export MongoDB collection to CSV file

by

Want to export MongoDB collection to CSV file?

Using MongoToFile, a native GUI tool, you can export MongoDB collection to CSV file easily and fast, no need to program, just a few mouse clicks!

Support all MongoDB deployment types: standalone, replica set, sharded cluster, and MongoDB Atlas.

Support Windows, Linux, macOS.

Here’s how to.

Example

Example source collection

export MongoDB collection to CSV file - source collection

After exporting, output file

export MongoDB collection to CSV file - output CSV file

Export

Please download and install MongoToFile, then run it.

Start MongoToFile, connect to MongoDB.

export MongoDB collection to CSV file - connect to mongodb

Then click “Export From Collection” at task dialog.

export MongoDB collection to CSV file - task window

Select “CSV” file type.

export MongoDB collection to CSV file - select type

1. Choose a MongoDB collection to export.

extract MongoDB collection to CSV file - select a collection

2. Set CSV options.

dump MongoDB collection to CSV file - config CSV file

3. Summary.

convert MongoDB collection to CSV file - summary

4. Export MongoDB collection to CSV file.

export MongoDB collection to CSV file - convert file

After exporting, you can view output CSV file.

export MongoDB collection to CSV file - view CSV file

Save/load session

You can save/load session to run “MongoDB collection to CSV file” conversion repeatly.

1.Save Session.

Click “Save Session” button, then enter a session file name.

export MongoDB collection to CSV file - save session

click “OK” button.

2.Load Session.

Click the “Open a Saved Session” in task window, select a session file.

export MongoDB collection to CSV file - load session

then show the wizard form, click a few “Next” to export MongoDB collection to CSV file.

export MongoDB collection to CSV file - start session

Run in command line

You can run “MongoDB collection to CSV file” conversion in command line.

When you save session, you can click “Save & Make Batch File”.

export MongoDB collection to CSV file - save session

The “Save & Make Batch File” form shows.

export MongoDB collection to CSV file - create batch file

Click “OK” button, you’ll create a batch file, in Windows, like this:

C:
cd "C:\Users\pansh\AppData\Local\Programs\MongoToFile"
MongoToFile task="C:\Users\pansh\Documents\test.uld" logfile="C:\Users\pansh\Documents\test.log"

You can run this batch file in command line.

Run as scheduled task

You can run “MongoDB collection to CSV file” conversion automatically at specific time.

On Linux/macOS, you can use Crontab.

For macOS, How to Fix Cron Permission Issues in macOS.

On Windows, in “Save & Make Batch File” form, you can click “Create & Schedule Task” to set a scheduled task.

Export MongoDB collection to CSV file - create batch file

And then, with scheduled task wizard, step by step.

Export MongoDB collection to CSV file - scheduled task application

Export MongoDB collection to CSV file - scheduled task name

Export MongoDB collection to CSV file - scheduled task time

Export MongoDB collection to CSV file - scheduled task user

Export MongoDB collection to CSV file - scheduled task information

You’ll see created task listed in scheduled task list.

scheduled task list

Download

Here you can download MongoToFile, and buy MongoToFile.

Download MongoToFile Download MongoToFile