Try Studio 3T for Free

Export Wizard

Download the Export Wizard here to get started and jump ahead to the relevant chapter:

Looking to import, not export? Use the Import Wizard instead to import data from CSV, JSON, BSON/mongodump, SQL, and another collection to MongoDB.

The Export Wizard

With Studio 3T’s Export Wizard, you can export MongoDB collections, views, queries, query results, or specific documents to CSV, JSON, BSON/mongodump, SQL, or another collection.

Once connected to a MongoDB database, there are three ways to access the Export Wizard.

Click on Export in the Global Toolbar.

Click on Export in the global toolbar
Right-click on any server, database, or collection in the Connection Tree and choose Export (Collections, Buckets, Views).

Export a collection from the Connection Tree

Or right-click anywhere on a Result tab (Collection Tab, SQL Query, IntelliShell), or any input or output panel in Aggregation Editor and choose Export (Documents).

Export documents from aggregation query

Studio 3T lets you export these sources while querying in Visual Query BuilderIntelliShellAggregation Editor, SQL Query, and other parts the application:

  • Entire collection(s) or view(s)
  • Current query result (find query, aggregation query)
  • Current cursor
  • Specific documents

For all exports, you can choose one of six actions from the toolbar. You can save exports as tasks, which you can execute on demand or schedule to run at a later date; execute the task immediately; add (export) units; edit units; or remove units.

Export Wizard toolbar

You can also always track your export’s progress in the Operations window, on the bottom-left hand side of the app.

Track the progress of your export under Operations

Export MongoDB to CSV (e.g. Excel)

Open the Export Wizard.

Select the export source, if applicable. Choose CSV as the export format.

Choose CSV as export format

Click Next.

Studio 3T performs a partial scan of 500 documents to automatically detect fields within your collection.

To detect all fields, you can click on Full scan – which might take some time – or manually add the missing fields by clicking on Add custom field.

Choose to perform a full scan or add custom fields to the CSV export

Click Finish.

This will open the Export overview tab and display the Export unit #1 – CSV tab by default.

The Export unit – CSV tab has six sections.

Export Unit - CSV tab

  1. Export source – Displays the source.
  2. Select fields – Add/remove custom fields and check/uncheck fields to be included in the export.
  3. Select target – Choose between clipboard or file, and define the file path as needed.
  4. CSV format – Configure settings like preset, delimit, record separator, etc.
  5. Other options – Configure non-formatting settings like how to treat null values, column headers, etc.
  6. Output preview – Shows a preview of the CSV file.

Go to the Export overview tab to configure global export options.

After configuring the export, you can choose to:

Choose to execute the export task from the toolbar

Export MongoDB to JSON

Open the Export Wizard.

Choose the Export source. In this example, we will export the current query result.

Export options in Studio 3T

Select JSON and click Next.

Choose JSON as the export format

Click Finish. This will open the Export overview tab and display the Export unit #1 – JSON tab by default.

The Export unit – JSON tab has five sections.

Export unit tab - JSON

  1. Export source – Make sure that the source (in this example, current query result) is correct. Note that you need to go back to the original query to edit it.
  2. Format options – Choose between JSON mongo shell/Studio 3T or JSON mongoexport.
  3. Select target – Select between clipboard or file, and define the file path as needed.
  4. Other options – Choose to export with commas between documents, or export as document array.
  5. Output preview – Displays the JSON preview dynamically as you configure the export settings.

What’s the difference between the two format options?

JSON mongo shell/Studio 3T exports a collection to a rich, type-conserving collection.json file, in the JSON format used in the mongo shell, which makes for an easy paste job.

JSON mongoexport produces a JSON format that the mongoexport tool generates.

Switch to the Export overview tab to configure global export options.

Once your unit is export-ready, you can choose to:

Choose to execute the export task from the toolbar

Export MongoDB to SQL

Moving data from collections to tables? MongoDB to SQL Migration lets you export MongoDB collections directly to a SQL database or file and configure MongoDB to SQL mappings before export.

Open the Export Wizard and choose SQL as the export format. Click Next.

Choose SQL as the export format

Choose one from eight supported SQL formats. Then, select the fields to include in the SQL export.

Studio 3T partially scans the collection to detect fields and map source types to SQL column types.

To detect all fields, click on Full scan or manually add the missing fields by clicking on Add custom field.

To override the auto-detected SQL column names and SQL column types, double-click and edit the value.

Click Finish.

The Export overview and Export unit #1 – SQL tabs will open.

The Export unit – SQL tab, where you can further edit the export, has seven sections.

Export Unit - SQL tab

  1. Export source – Displays the source.
  2. SQL format – Displays the target SQL format.
  3. Select fields – Here you can add/remove custom fields, move fields up/down, check/uncheck, and edit SQL field names and types.
  4. Select target – Select between clipboard or file, and define the file path as needed.
  5. SQL table name – Enter the SQL table name.
  6. Other options – Configure other settings like adding “CREATE TABLE” and “DROP TABLE IF EXISTS” statements.
  7. Output preview – Shows a preview of the SQL file.

Configure settings as needed in the Export overview tab.

Once you’re done setting up the export, you can choose to:

Choose to execute the export task from the toolbar

Export MongoDB to SQL is a feature available in Studio 3T Pro and Enterprise. Studio 3T supports all the major SQL databases: Oracle, Microsoft SQL Server, MySQL, Sybase, and PostgreSQL.

Export MongoDB to BSON/mongodump

Open the Export Wizard and choose mongodump as the export format.

Click Finish. This will open the Export overview tab and display the Export unit #1 – mongodump tab by default.

The Export unit – mongodump tab has four sections.

Export unit - mongodump tab

  1. Export source – Shows the export source.
  2. Format options – Choose between BSON – mongodump folder or BSON – mongodump archive.
  3. Select the destination folder – Define the folder path as needed.
  4. Other options – Configure other settings like compression, document recovery, etc.

! The options visible here will depend on the version of mongodump you’re using. Click /program/mongodump/

Switch to the Export overview tab to configure global export options.

Once your unit is export-ready, you can choose to:

Choose to execute the export task from the toolbar

Export to another collection

Open the Export Wizard and choose Another collection.

Click on Click here to connect to a server, which should open the Connection Manager.

Choose the target collection

Choose the target server and click Connect. Then, choose the collection and click Finish.

This will open the Export overview tab and display the Export unit #1 – Another collection tab by default.

The Export unit – Another collection tab has three sections.

Export unit tab for another collection

  1. Export source – Displays the export source.
  2. Export target – Click on Change export target to choose the target collection.
  3. Export mode – Choose one of six export modes.

Go to the Export overview tab to configure global export options.

After you’ve configured your export, choose to do one of the following:

Choose to execute the export task from the toolbar

How to trigger export sources and formats

You might not see all export sources options at first, because the prompt you see will depend on which item(s) you’re trying to export – or where you’ve clicked in the application.

If no item is selected, clicking on Export in the global toolbar will prompt you to choose the export source.

Prompt when no item is chosen

When you choose items from the Connection Tree and click on Export, it will ask you to choose the export format directly. Note that depending on the items chosen, only the applicable formats will be highlighted:

Choosing items from the connection tree

When you click on Export from a Result tab (Collection Tab, IntelliShell, SQL Query), or an input or output panel in Aggregation Editor, it will ask you – on a granular level – which items you want to export.

Export options in Studio 3T

Current query result vs. current cursor – what’s the difference?

Exporting the current query result means that Studio 3T will always run the query before the export. You will always get the latest results and can keep working with them, but means that it might take longer. This option is compatible with mongodump.

Exporting the current cursor is faster, but it only exports the current results. If you need to work with the results after the export, you will need to re-run the query and re-export any new results. This option is not compatible with mongodump.

After you’ve selected an export source and export format, the export is considered as one (export) unit.

The Export Wizard lets you add multiple units – or multiple exports – to one job, so you can run multiple exports at once.

You can always find an overview of all export units in the Export overview tab, where you can configure global options, and add, edit, and remove units as needed.

Overview of export units

How export units work

The Export Wizard treats each export as an export unit. Instead of having to run single exports one after another, it lets you add multiple export units to be run in a single job, which is a huge time-saver in tandem with Tasks and Tasks Scheduler.

Add export units

Choose Add unit from the toolbar.

Add unit button in the toolbar

This will prompt you to choose your new unit’s export source.

Let’s choose Connection tree item and click Next.

Choose the new unit's export source

Note that the Find query and Aggregation query options will only work if results have been copied to the clipboard.

Click on Click here to connect to a server.

This will open the Connection Manager. Choose the target server, then click Connect.

Connect to a server from the Export Wizard

Next, chose the connection tree items (databases, collections, views) to export. You can choose multiple items at once. Click Next.

Choose connection tree items to export

The next window will prompt you to choose among possible export formats. Since we chose to export two collections, only JSON and mongodump are possible options.

Click Finish.

Limited export options when choosing multiple collections

Each export should open a separate Export unit tab.

Under the Export overview tab, you can find an overview of all export units bundled in your job. Here, you can also configure global export options.

Overview of export units

You can also drag items directly from the Connection Tree into the Export units section (in this case, the rainfall collection).

Drag export units from the Connection Tree

Edit export units

From the Export overview tab, you can edit an export by:

Edit units from the Export overview tab

  • Double-clicking on the export unit – this should lead you straight to the export unit’s respective tab
  • Choose the unit to edit and click on Edit unit in the toolbar
  • Right-click on the unit and choose Edit selected items

Remove export units

Choose the Export unit tab to be removed (#2 in the screenshot) and click on Remove unit in the toolbar.

Choose Remove unit from the toolbar

Alternatively, go to the Export overview tab, select the unit to be removed, and either click on Remove unit in the toolbar or right-click and choose Remove selected items.

Remove selected units from the Export units overview

Automate & schedule exports as tasks

Export Wizard integrates with two other features – Tasks and Task Scheduler – so that you can save frequently-run exports as tasks.

Click on Save task (as) to save an export as a task.

Click on Save task on the Export Wizard toolbar

  • Save task – Saves the task with its current name, or prompts the user to name it if it wasn’t saved yet.
  • Save task as – Prompts the user to name the task and save it.

Name the task.

Track the progress of your export under Operations

Click OK. This should save the task successfully, which you can view in Task Viewer.

Task saved successfully in Export Wizard

From the Task Viewer, you can choose to schedule, unschedule, edit, clone, delete, add, and execute tasks. Learn more about Tasks and Tasks Scheduler.


Check out other time-saving Studio 3T features:

Updated on March 23, 2020

Was this article helpful?

Related Articles