Navigation
This documentation refers to the MongoDB Charts service in MongoDB Atlas. Read the on-premises documentation to learn how to use the MongoDB Charts on site.

View and Export Chart Data

While editing a chart in the Chart Builder, you can view underlying data from the Ellipses (…) dropdown menu. Access to underlying data is intended to help you build meaningful charts as well as export that data for use with third-party tools.

The ellipse menu is in the top-right corner of the charts editor.

View Source Documents

Once you have selected a data source for your chart, you can view up to 20 sample documents from that data source by clicking View Source Documents from the ellipsis h icon menu.

Note

If you want to explore your data source beyond 20 sample documents, you can use Compass or the Atlas Data Explorer.

The sample documents are intended for reference to help you build a chart. The documents do not reflect any groupings or projections applied to an existing chart (i.e. any Encode panel options in the Chart Builder). The documents are produced with a query on your data source that considers:

The Source Documents modal displays the number of documents from your data source that match your query conditions, although only 20 of the documents are viewable as samples.

The View Source Documents modal displays the document count just above the document samples.

View Aggregation Pipeline

After you have configured a valid chart, you can view the source query for the chart. MongoDB Charts uses a special type of query to create a chart called an aggregation pipeline. To view the query, click View Aggregation Pipeline from the ellipsis h icon menu. This aggregation pipeline includes the stages that both the data source and the Chart Builder apply.

Important

Some Chart Builder configuration options don’t apply aggregation stages. These options are applied to a chart’s visualization and do not affect the underlying data.

To use the pipeline in other MongoDB tools, such as Compass or the mongo shell, click copy icon next to the pipeline in the Aggregation Pipeline modal.

Get Chart Data

After you have configured a valid chart, you can view and export the underlying data as a table. To view the chart data, click Get Chart Data from the ellipsis h icon menu. Each row in the table represents a data point.

Data Table Differs from Chart Visualization

Some configuration options you see reflected on a chart visualization are not applied to the data table. The Chart Data table displays underlying data retrieved with your full aggregation pipeline, and not all Chart Builder configuration options apply aggregation stages. Review your data to verify its contents.

If you want to analyze your underlying data with a third-party tool, you can download your data from the Chart Data modal. To download your data, click Download - CSV or Download - JSON.

Viewing chart data will display a table of the values used to create a chart. It also allows for downloading a CSV or JSON representation of that table.