Knowledge base · Studio 3T Desktop IDE

Copy MongoDB Query Results to CSV, Excel & Google Sheets

By Kathryn Vargas · Updated

Here’s the fastest way to copy query results from MongoDB to CSV, Excel – even Google Sheets.

Please note that this functionality fully supports pasting in Microsoft Excel, but might not work with other third-party spreadsheet software.

1. Run a query in Studio 3T. I’ve used the Visual Query Builder below, but you can also write queries in IntelliShell, Aggregation Editor or SQL Query.

A query built using Visual Query Builder

I’ve built the query in the Query section so that my results only contain customers who (1) live in Chicago, (2) have opted for priority support, and (3) have ordered more than 50 times.

I’ve also applied a projection and sort in the Projection and Sort sections to clean up a bit, as this is how I’d like to paste the data in Google Sheets.

2. Choose Table View in the drop-down.

Choose Table View in the dropdown menu

3. Right-click on the query results you want to copy from MongoDB to CSV or Excel. Choose whether to include the headers or not.

Choose CSV or Excel, with or without the headers

If you’re exporting MongoDB query results to Google Sheets, choose Copy Selected Documents for Excel

4. Paste the results directly in Excel or Google Sheets, or as CSV.

Export MongoDB to Excel or Google Sheets

And there you have it: the quickest way to export MongoDB query results to Excel, Google Sheets, and CSV.

Download Studio 3T for free to try it out for yourself, along with these other handy copy-paste features:

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, including personalized advertising (“performance”), to provide you with additional functions (“functional”), and to show content from social media platforms, such as embedded videos (“social media”). 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 section 9 of our Privacy Policy.

Manage consent preferences