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.
Before You Begin
To configure a read preference, you must have at least Project Data Access Read Only access to the project.
Steps
In Atlas, go to the Data Explorer page for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
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.
Select a read preference mode.
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.
Optional. Specify read preference tags and max staleness.
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:valuepairs, such asnodeType: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.
Example
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