Skip to content
Studio 3T - The professional GUI, IDE and client for MongoDB
  • Tools
    • Aggregation Editor
    • IntelliShell
    • Visual Query Builder
    • Export Wizard
    • Import Wizard
    • Query Code
    • SQL Query
    • Connect
    • Schema Explorer
    • Compare
    • SQL ⇔ MongoDB Migration
    • Data Masking
    • Task Scheduler
    • Reschema
    • More Tools and Features
  • Solutions
  • Resources
    • Knowledge Base
    • MongoDB Tutorials & Courses
    • Tool/Feature Documentation
    • Blog
    • Community
    • Testimonials
    • Whitepapers
    • Reports
  • Contact us
    • Contact
    • Sales Support
    • Feedback and Support
    • Careers
    • About Us
  • Store
    • Buy Now
    • Preferred Resellers
    • Team Pricing
  • Download
  • My 3T
search

Studio 3T® Knowledge Base

  • Documentation
  • Tutorials
  • Workshops
Take the fastest route to learning MongoDB. Cover the basics in two hours with MongoDB 101, no registration required.
Start the free course

Export Wizard

Posted on: 14/10/2020 (last updated: 09/03/2022) by Kathryn Vargas

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.

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

  • Export MongoDB to CSV
  • Export MongoDB to JSON
  • Export MongoDB to SQL (Oracle, Microsoft SQL Server, MySQL, and PostgreSQL)
  • Export MongoDB to BSON/mongodump
  • Export to another MongoDB collection

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

Open the Export Wizard

Once connected to a MongoDB database, open the Export Wizard by clicking on Export in the Global Toolbar.

Click on Export in the global toolbar

Alternatively, you can right-click on any server, database, or collection in the Connection Tree and choose Export (Collections, Buckets, Views).

Export 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.

Export MongoDB documents directly from the Results tab

Export sources

With Studio 3T, you can export the following throughout the application:

  • Entire collections
  • Entire views
  • The current query result of a find() or aggregation query
  • The current cursor
  • Specific documents
Studio 3T-supported export sources

For all exports, you can choose one of six actions from the toolbar:

  • Save the export as a task, which you can execute on-demand or schedule for later
  • Execute the task immediately
  • Add, edit or remove export units
The Export Wizard toolbar

Learn more about how to trigger export sources and formats.

Change the export source

While configuring your export, you can also change the export source (e.g. connection, database, collection) at any time.

Under Export source in the Export unit tab, you can:

  • Click to change the source from your list of databases or connections
  • Drag the source from the Connection Tree directly into the tab
Change databases, connections, and connections by dragging directly from the Connection Tree

If you’re exporting find() query results, you can edit them directly in the Query bar of any Export unit tab.

The Query bar also validates your JSON as you type.

Edit find queries on the go during export

Change the export file path

You can also configure the default target folder in the Export Overview tab. Studio 3T will remember any changes to this path.

Configure the default target folder path under global options

Export MongoDB to CSV (e.g. Excel)

Open the Export Wizard and select your export source.

This screen only appears if you haven’t chosen an item in the Connection Tree, run a previous query, or selected specific documents.

Choose export source

Next, choose CSV as the export format then click Next.

Choose CSV as export format

Studio 3T performs a partial scan of 100 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 which fields to export to CSV, or add custom fields

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.

  1. Export source – Displays the source connection, database, and collection. You can change this by clicking within the blue dotted box, or by dragging the source from the Connection Tree directly into the tab.
  2. Select fields – Add or remove custom fields and check or uncheck fields to be included in the export.
  3. Select target – Choose between clipboard or file, and define the file path as needed.
CSV configuration options in Studio 3T

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 – Click on the arrow button to expand the preview of the CSV file.

More CSV configuration options in Studio 3T

To configure global export options, go to the Export overview tab.

Configure global options in the Export Overview tab

After configuring the export, you can run the export immediately by clicking on Execute in the toolbar.

Click on Execute to run the export

You can also run multiple CSV exports at once by adding more export units.

To save time, you can save your CSV export as a task, which you can then schedule to run later.

To track your export’s progress, check the Operations window on the bottom-left hand corner.

From here you can also directly view the export file. Right-click on an export in the same window and choose Open in File Explorer (Windows, Linux) or Reveal in Finder (macOS).

Get to your exported file directly from the Operations window

Ready to export? Download the latest Studio 3T version here.

Export MongoDB to JSON

Open the Export Wizard and choose your export source.

This screen below will appear if you haven’t chosen an item in the Connection Tree, run a previous query, or selected specific documents.

Choose export source

In this example, we will export the current query result of the find() query { "package": "Premium" }, which we built using Visual Query Builder.

Export current query results
Export options in Studio 3T

Next, select JSON as the export format 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.

  1. Export source – Displays the source connection, database, and collection. Make sure that the source is correct. In this example, we are exporting the current query result of the find() query { "package": "Premium" }. You don’t need to go back to the original query to edit it – you can do so edit directly in the Query bar.
  2. Format options – Choose between JSON mongo shell/Studio 3T or JSON mongoexport.

What’s the difference between the two JSON 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.

3. Select target – Select between clipboard or file, and define the file path as needed.

Five sections of the JSON export unit tab

4. Other options – Choose to export with commas between documents, or export as document array.

5. Output preview – Click on the arrow to display the JSON preview, which dynamically updates as you configure the export settings.

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

Configure global options in the Export Overview tab

Once your unit is export-ready, click on Execute to run the export immediately.

Click on Execute to run the export

Alternatively, run multiple JSON exports at once by adding more export units, or save the JSON export as a task, which you can then schedule to run later.

You can track your JSON export’s progress in the Operations window, on the bottom-left hand corner.

Get to your exported file directly from the Operations window

To view the export file, right-click on an export in the same window and choose Open in File Explorer (Windows, Linux) or Reveal in Finder (macOS).

Download Studio 3T to start your JSON export.

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.

  • MongoDB to SQL Migration
  • Export MongoDB to SQL in 5 Steps

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

Choose SQL as the export format

Choose one of the supported SQL databases: MySQL Server, Microsoft SQL Server, PostgreSQL, and Oracle Database.

Supported SQL databases

Then, select the fields to include in the SQL export.

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

Select the fields to include in the export to SQL

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 on a cell 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.

  1. Export source – Displays the source.
  2. SQL format – Displays the target SQL format.
  3. Select fields – Here you can add or remove custom fields, move fields up or down, check or uncheck, and edit SQL field names and types.
Select the fields to include in the export to SQL

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 – Click on the arrow to show a preview of the SQL file.

More configuration options

Configure other global settings as needed in the Export overview tab.

Once you’re done setting up the export, you can run the export immediately by clicking on Execute in the toolbar.

Click on Execute to run the export

Alternatively, add more export units so that you can run multiple SQL exports in one go, or save the SQL export as a task that you can run on-demand or schedule for later.

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

Export MongoDB to BSON or mongodump

Open the Export Wizard.

You will see the screen below if you haven’t chosen an item in the Connection Tree, run a previous query, or selected specific documents.

Choose export source

Choose mongodump as the export format and 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.

  1. Export source – Shows the export source connection, database, and collection. You can change this by clicking within the blue dotted box, or by dragging the source from the Connection Tree directly into the tab.
  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.
mongodump export options

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

Once your unit is export-ready, you can run the export immediately by clicking on Execute.

Click on Execute to run the export

To run multiple exports in one job, you can also add export units, or save the BSON export as a task that you can schedule to run later.

Export to another collection

Want a faster solution? Copy and paste MongoDB collections between databases instead.

Open the Export Wizard.

If you haven’t chosen an item in the Connection Tree, run a previous query, or selected specific documents, you will be prompted to choose an export source.

Choose export source

Once you’ve made a selection, choose To another collection the click Next.

Export to another collection

Click on Click here to connect to a server to select a target connection. This will open open the Connection Manager.

Choose the target connection

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.

  1. Export source – Displays the export source connection, database, and collection. You can change this by clicking within the blue dotted box, or by dragging the source from the Connection Tree directly into the tab.
  2. Export target – Shows the export target connection/database/collection. You can edit this by clicking within the blue dotted box, or by dragging the source from the Connection Tree directly into the tab.
  3. Export mode – Choose one from the six export modes.
Configuration options when exporting to another collection

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

After you’ve configured your export, you can run the export immediately by clicking on Execute in the toolbar.

Click on Execute to run the export

Alternatively, add more export units so that you can run multiple exports at once, or save the export as a task that you can run on-demand or schedule for later.

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.

Name the task, then click OK.

Save MongoDB exports as tasks

This saves the task in the Task Viewer, from which you can choose to schedule, unschedule, edit, clone, delete, add, and execute tasks.

Learn more about Tasks and Tasks Scheduler.

Masking data on export

You can also specify data masking rules when using our Data Masking tool, allowing you to obfuscate collections on a field level.

On the Export Wizard tab, scroll down to the Data Masking subsection and click Open field masking editor to begin configuring your data masking rules. The original data source won’t be overwritten.

studio3t data masking on export

Learn more about Data Masking for MongoDB.

Export multiple or all MongoDB collections at once

The Export Wizard treats each export as an export unit.

Instead of having to run single exports one after another, you can add multiple export units that you can run at once, which is a huge time-saver in tandem with Tasks and Tasks Scheduler.

Add export units

Set up your first export unit using your format of choice:

  • Export MongoDB to CSV
  • Export MongoDB to JSON
  • Export MongoDB to SQL (Oracle, Microsoft SQL Server, MySQL, and PostgreSQL)
  • Export MongoDB to BSON/mongodump
  • Export to another MongoDB collection

The quickest way to add new export units is to drag items directly from the Connection Tree into the Export units section (in this case, the expats collection).

Drag new export units directly from the Connection Tree

Alternatively, choose Add unit from the toolbar.

Click on Add Unit in the Export Wizard toolbar

This will prompt you to choose your new unit’s export source. Here we’ll choose Connection tree item.

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.

Choose your source connection

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

Choose the connection tree items to export

Then, choose the export format.

Configure the new export unit as you would any export. Each export will open in a separate Export unit tab.

Each MongoDB export opens in a separate Export unit tab

Under the Export overview tab, you can find an overview of all export units bundled in your job.

Run multiple exports at once

Edit export units

Click on Edit unit in the toolbar.

Edit export units

From the Export overview tab, you can also double-click on the export unit, or right-click on the unit and choose Edit selected units.

Remove export units

Click on Remove unit in the toolbar.

Remove export units

Alternatively from 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.

Trigger export sources and formats

At first glance, you might wonder why you don’t see all available export sources options.

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.

Export Wizard will highlight the relevant formats depending on what you've selected

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 skip the previous prompt and ask you directly 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.

Run multiple exports at once

Check out other time-saving Studio 3T tools:

  • Import Wizard – Import CSV, JSON, BSON, SQL and other formats to MongoDB
  • SQL Query – Use SQL to query MongoDB and see how they translate to MQL
  • Aggregation Editor – Build MongoDB aggregation queries in stages
  • Query Code – Generate Java, Node.js, Python, PHP, and C# code from MongoDB queries


How helpful was this article?
This article was hideous
This article was bad
This article was ok
This article was good
This article was great
Thank you for your feedback!

About The Author

Kathryn Vargas

When she's not writing about working with MongoDB, Kathryn spends her free time exploring Berlin's food scene, playing the drums, learning languages (current mission: German), and hiking.

Article navigation

Related articles

  • What’s New in Studio 3T 2020.4 | Introducing License Manager, IBM DB2 Migration Support, Export Wizard Improvements
  • What’s New in Studio 3T 2020.7 | Export Documents from Table View to CSV, Edit find() Queries During Export & More
  • Import Wizard
  • How do you make Studio 3T export MongoDB collections to unique files? #Studio3T_AMA
  • How do I export (or copy and paste) particular columns of data? #Studio3T_AMA

Studio 3T

MongoDB Enterprise Certified Technology PartnerSince 2014, 3T has been helping thousands of MongoDB developers and administrators with their everyday jobs by providing the finest MongoDB tools on the market. We guarantee the best compatibility with current and legacy releases of MongoDB, continue to deliver new features with every new software release, and provide high quality support.

Find us on FacebookFind us on TwitterFind us on YouTubeFind us on LinkedIn

Education

  • Free MongoDB Tutorials
  • Connect to MongoDB
  • Connect to MongoDB Atlas
  • Import Data to MongoDB
  • Export MongoDB Data
  • Build Aggregation Queries
  • Query MongoDB with SQL
  • Migrate from SQL to MongoDB

Resources

  • Feedback and Support
  • Sales Support
  • Knowledge Base
  • FAQ
  • Reports
  • White Papers
  • Testimonials
  • Discounts

Company

  • About Us
  • Blog
  • Careers
  • Legal
  • Press
  • Privacy Policy
  • EULA

© 2023 3T Software Labs Ltd. All rights reserved.

  • Privacy Policy
  • Cookie settings
  • Impressum

We value your privacy

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes ("analytics and marketing") and to provide you with additional functions (“functional”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data.

By clicking “Accept all”, you consent to the storage of cookies and the processing of personal data for these purposes, including any transfers to third countries. By clicking on “Decline all”, you do not give your consent and we will only store cookies that are necessary for our website. You can customize the cookies we store on your device or change your selection at any time - thus also revoking your consent with effect for the future - under “Manage Cookies”, or “Cookie Settings” at the bottom of the page. You can find further information in our Privacy Policy.
Accept all
Decline all
Manage cookies
✕

Privacy Preference Center

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes ("analytics and marketing") and to provide you with additional functions (“functional”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data. Please choose for which purposes you wish to give us your consent and store your preferences by clicking on “Accept selected”. You can find further information in our Privacy Policy.

Accept all cookies

Manage consent preferences

Essential cookies are strictly necessary to provide an online service such as our website or a service on our website which you have requested. The website or service will not work without them.

Performance cookies allow us to collect information such as number of visits and sources of traffic. This information is used in aggregate form to help us understand how our websites are being used, allowing us to improve both our website’s performance and your experience.

Google Analytics

Google Ads

Bing Ads

Facebook

LinkedIn

Quora

Hotjar

Reddit

Functional cookies collect information about your preferences and choices and make using the website a lot easier and more relevant. Without these cookies, some of the site functionality may not work as intended.

HubSpot

Social media cookies are cookies used to share user behaviour information with a third-party social media platform. They may consequently effect how social media sites present you with information in the future.

Accept selected