For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Configure Read Preference in the Atlas UI

By default, the Atlas UI reads from the primary member of your cluster. To send reads to a different member instead, such as an analytics node, set a read preference for your connection.

Important

Your read preference setting applies only to your current browser session. After you close or reload the page, the Atlas UI uses the default read preference again.

To configure a read preference, you must have at least Project Data Access Read Only access to the project.

1
  1. If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your project from the Projects menu in the navigation bar.

  3. In the sidebar, click Data Explorer under the Database heading.

    The Data Explorer displays.

IMPORTANT: You can also click the name of a cluster to open the Cluster sidebar, and then click Data Explorer under the Shortcuts heading.

2

You can't edit an active connection. In the Connections sidebar, click the icon next to your cluster. In the drop-down menu that appears, click Disconnect.

3

Click the icon next to your cluster. In the drop-down menu that appears, click Edit connection.

4

Under Read Preference, select one of the following modes:

  • Default, which leaves the read preference unset so that the Atlas UI reads from the primary

  • Primary
  • Primary Preferred
  • Secondary
  • Secondary Preferred
  • Nearest

To learn how each mode routes reads, see Read Preference Modes.

5

If you select Primary Preferred, Secondary, Secondary Preferred, or Nearest, you can also set the following fields:

  • Read Preference Tags: Enter each tag set as comma-separated key:value pairs, such as nodeType:ANALYTICS,region:US_EAST_1. To add another tag set, click the icon.

    The Atlas UI tries tag sets in order. To fall back to any eligible member when no member matches your tag sets, leave the last tag set empty. To learn which tags Atlas applies to your cluster nodes, see Query using Pre-Defined Replica Set Tags.

  • Max Staleness Seconds: The maximum replication lag, in seconds, that a secondary can have and still be eligible for reads. You must set Max Staleness Seconds to at least 90.

6

The Atlas UI reconnects to your cluster and routes reads according to your read preference.

To read only from the analytics nodes in your cluster, set the following values in the Edit Connection dialog box:

  • Read Preference: Secondary

  • Read Preference Tags: nodeType:ANALYTICS

Rate this page