CData Python Connector for MongoDB

Build 25.0.9454

ReadPreferenceTags

This property is used to identify and interact with one or more members of a replica set that are linked to specific tags.

Data Type

string

Default Value

""

Remarks

To use the ReadPreferenceTags property, it is necessary to configure the ReadPreference to a value other than the default 'primary' value. The required format consists of a list of semicolon-separated tag sets, where each tag set includes key-value pairs separated by commas.

For example:

  • tag1:val1,tag2:val2;: Find members with both tag values. If none are found, find any eligible member.
  • tag1:val1;tag2:val2;: Find members with the specified tag1, otherwise find members with the specified tag2. If none are found find any eligible member.
  • tag1:val1: Find only members with the specified tag.
  • ;: (semicolon only) Find any eligible member. If left empty, any eligible member is targeted.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9454