Navigation

Refresh Dashboard Data

MongoDB Charts automatically refreshes chart data once it becomes out of date with the backing data source. You can also manually refresh dashboard data at any time.

Configure Auto Refresh Settings

Charts on a dashboard automatically refresh once their data becomes out of date. You can specify how stale your charts’ data can be before it is refreshed. This is known as your staleness tolerance. The default behavior is to refresh when data is one hour stale.

To configure auto-refresh settings for a dashboard:

  1. Select a dashboard from the Dashboards page.
  2. Click Settings at the top of the dashboard.
  3. Select your data staleness tolerance from the dropdown. Charts supports staleness tolerances between 1 minute and 30 days.
  4. Click Save.

Manually Refresh Data

You can manually refresh an entire dashboard or individual charts to render your charts with the latest data. In a manual refresh, MongoDB Charts reloads data even if the current data is within your specified staleness tolerance.

MongoDB Charts users of all permission levels can refresh dashboard data.

Manually Refresh an Entire Dashboard

Manually refresh an entire dashboard to requery all of the data sources backing your charts and render your charts with the latest data.

To manually refresh dashboard data:

  1. Select a dashboard from the Dashboards page.
  2. Click the arrow next to the Settings button.
  3. Click Force Refresh.

Manually Refresh a Single Chart

Manually refresh a single chart to only requery the data source for that chart and render that chart with the latest data.

To manually refresh a single chart:

  1. Select a dashboard from the Dashboards page.
  2. Click the arrow next to the Settings button.
  3. Click Force Refresh.

Refresh Behavior

  • When Charts refreshes dashboard data, only charts with data older than your specified staleness tolerance are refreshed. Charts does not refresh the entire dashboard at once.

  • Auto-refresh settings are stored in the local browser state. These settings are not persisted with the dashboard or shared between users.

  • Hover over the timer at the bottom of the chart to view more information.

    Chart refresh timer.

    What you see depends on where you view the chart and if the last refresh failed:

    Viewing Method Details You See
    Authenticated Dashboard
    • The error code that describes why the refresh failed, if applicable.
    • Time since the last refresh occurred.
    • Time until the next automatic refresh occurs.
    Dashboard Accessed with a Public Link
    • Time since the last refresh occurred.
    • Time until the next automatic refresh occurs.
    Embedded using an iframe or the SDK
    • The embedding error code that describes why the refresh failed, if applicable.
    • If the chart is configured to automatically refresh: - Time since the last refresh occurred. - Time until the next automatic refresh occurs.

Caching Behavior

When MongoDB Charts loads charts on a dashboard, it does not consistently query the data source for each chart. Instead, MongoDB Charts queries the data sources when the dashboard first loads, and that data is cached on both the client and server.

Note

The data stored in the cache is encrypted with a key specific to your MongoDB Charts tenant.

  • When a dashboard refreshes automatically:

    • If a chart’s data is within the staleness tolerance period, Charts doesn’t refresh the chart’s data.

    • If a chart’s data is outside of the staleness tolerance period, Charts returns the latest data from the server cache. If the server cache contains stale data, Charts queries the data source for the latest data, refreshes the chart, and updates the data cached on both the client and server.

      Note

      If your chart is embedded using Realm Authentication and Fetch data using Realm App is enabled in your Authentication Provider Settings, your chart does not load data from the server cache. Your maxDataAge embedding parameter still dictates how often the chart refreshes, but the data source is always queried on each render.

  • When you manually refresh an entire dashboard, Charts updates all chart data by querying the data source for the latest data even if the chart data is within the specified staleness tolerance period.

Refresh Failures

When an automatic or manual refresh fails:

  • MongoDB Charts displays the most recently rendered chart, including all of the chart’s interactive elements.

  • If MongoDB Charts has never successfully rendered the chart, the following message is displayed: Unable to load data.

  • MongoDB Charts displays the following error message at the bottom of the chart: Last refresh failed.

  • If you’re viewing the chart on an Authenticated Dashboard, click the failed link in the error message to view additional error details.

    Note

    This link is not available when you view charts on a dashboard from a public link or embedded using an iframe or the SDK.

  • The error message includes a Refresh link if the chart is rendered on an authenticated dashboard or embedded using an iframe or the SDK. Click the link to manually refresh the chart.