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

Sample Mode

Enabling Sample Mode in MongoDB Charts restricts the input collection to 1000 randomly selected documents. To toggle Sample Mode, use the toggle above the Data Source dropdown. The sample mode setting for a chart persists when the chart is rendered on a dashboard, meaning that if you enable sample mode when building a chart, the data rendered in the dashboard will also be sampled.


When sampling mode is enabled and you have specified a filter, the sample of 1000 documents is taken before the filter is applied, meaning there may be fewer than 1000 documents used to plot the chart.

Use Cases

Consider using sample mode in the following scenarios:

  • When drafting a chart and heavily modifying chart options. In this situation, sampling mode allows the chart to render quickly during the building process. Once you are satisfied with your chart you can disable sample mode to have all documents included in your final visualization if desired.
  • When visualizing a large data source and the chosen data is sufficiently aggregated (e.g. showing averages of fields) so not all documents are needed to obtain a useful visualization. In this case, leaving sample mode enabled for the rendered dashboard allows you to retain a useful chart.


Due to the random nature of sampling, when Sample Mode is enabled, it is possible your visualizations will change each time the chart is loaded.