Navigation
This documentation refers to the on premises version of MongoDB Charts. For documentation on the MongoDB Charts SaaS application in Atlas, click here.

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.

Note

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.

Note

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.