xp-forge / mongodb

MongoDB for the XP Framework
0 stars 0 forks source link

Implement tag sets when selecting a server #20

Open thekid opened 2 years ago

thekid commented 2 years ago

Tags are not compatible with mode primary, and in general, only apply when selecting a secondary member of a set for a read operation. However, the nearest read mode, when combined with a tag set, selects the matching member with the lowest network latency. This member may be a primary or secondary.

See https://www.mongodb.com/docs/manual/core/read-preference-tags/#std-label-replica-set-read-preference-tag-sets