With Studio 3T, carry out your MongoDB import and export tasks without having to type a single command line using the following formats: JSON, CSV, SQL, BSON/mongodump, and another collection.
Supported import formats
Studio 3T supports the following import file types:
Additionally, data can be imported from:
- A SQL database
- Another collection
Open the Import Wizard
After successfully connecting to a MongoDB database, there are two ways to open the Import Wizard:
Click on Import in the Global Toolbar.
Right-click on any server, database, or collection and choose Import.
Import JSON to MongoDB
- With the import wizard open, tick the JSON box as the chosen import format.
- The next screen allows for one or multiple JSON files to be imported. Click on + to upload documents, – to remove them, and the clipboard icon to paste data from the clipboard.
- Under the Target Database, Target Collection, and Insertion Mode columns, double-click on a cell to select the appropriate database or collection, and define the insertion settings for the documents.
- Click Next. Studio 3T will show a preview of what the server will look like after import.
- The last screen will show an Import Summary and is the last chance to make edits.
- Once everything looks good, click Start import.
Import CSV (e.g. Excel) to MongoDB
- Choose CSV in the import wizard and click next.
- Here, specify the file to be imported as well as the import specifications.
- The next step is to choose desired delimiters and text qualifiers, then click Next.
- Choose the right CSV options and click Next.
- All that is left now is to review the summary of what the new server will look like after the import is complete.
- Finally, begin the import.
Supported date formats
CSV import supports eight date formats:
The date format XXX supports all order variations of the year, month, and day fields, as well as three separators: “-“, “/” and “.”
Both ISO and Locale formats accept their respective variations like date only, date with short or long time, etc.
Upon CSV import, Studio 3T will try to detect a suitable date format for all the values of a column and will automatically use one based on the following criteria:
- The above date formats are tested in the given order with all the values of a column/field
- The first format to match all values is selected as suggested date type for the field or column
But of course, as with all data types, the selection can always be overriden.
Import BSON/mongodump to MongoDB
- Open the import wizard and choose between BSON – mongodump folder or BSON – mongodump archive and click Next.
- Choose the mongodump folder or archive file to import and click Next. Make sure sure the mongodump folder doesn’t have any compressed files.
- If importing a folder: Choose the databases and collections to import, if applicable. If importing an archive file, jump to Step 5.
- A preview of what your server will look like after the import will appear. Click Next.
- Choose the mongorestore options and click Next.
- Review the import summary and click Start Import.
Import SQL to MongoDB
- Choose SQL Database in the import wizard.
- Here, connect to the SQL server, choose the SQL table and the target database, target collection, and import mode. Then, click Next.
- Define the import settings as needed in the Configure SQL Columns Import screen, then click Next.
- Preview the import, then click Next.
- Click Start Import.
Import another collection
- Open the import wizard and choose Another Collection.
- Then choose the location of the desired collection.
- Choose the target database and collection and decide how Studio 3T should deal with duplicate documents.
- Preview the server and read the import summary.
- Once everything looks good, start the import!
Supported export formats
Studio 3T supports the following formats:
- To another collection
Open the Export Wizard
Similar to the Import Wizard, the Export Wizard can be accessed two ways:
Click on Export found in the Global Toolbar.
Right-click on any server, database, or collection and choose Export.
When it comes to exporting data, Studio 3T offers several options. Users can export:
- Entire collection(s) or view(s)
- Current query result
- Specific documents
Export MongoDB to JSON
When exporting MongoDB to JSON, you have the option of either exporting:
- JSON mongo shell / Studio 3T
- JSON mongoexport
Exporting 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.
Exporting JSON mongoexport produces a JSON format that the mongoexport tool generates.
- Choose JSON in the export wizard and click Next.
- Choose between JSON mongo shell/Studio 3T or JSON mongoexport.
- Choose the export target file destination and click Next
- Review the export summary and click Start Export.
Export MongoDB to CSV (e.g. Excel)
- Choose CSV in the export wizard and click Next.
- Choose your CSV format options and click Next.
- Here, choose the fields to be exported and click Next.
- Choose the target file destination for the export and click Next.
- Review the export summary and click Start Export. Choose where the data should be exported to, or simply export to Clipboard.
Export MongoDB to SQL
- Open the export wizard, choose SQL, and click Next.
- Name your SQL table and choose your SQL format.
- Choose the fields to be exported.
- Studio 3T matches the Source Type with the closest SQL type, but can be manually overriden. Rename the SQL column if needed.
- Review the export summary and click Start Export.
Export MongoDB to BSON/mongodump
- Open the export wizard, choose mongodump, and click Next.
- Choose between two export options: BSON – mongodump folder or BSON – mongodump archive.
- Select the export target folder or archive file.
- Review the export summary and click Start Export
Export to another collection
- Open the export wizard and choose Another Collection.
- Choose the target database, target collection and export mode, then click Next.
- Read over the Export Summary and once everything looks good, click Start Export.