读取偏好、读关注和写关注以及排序规则可以被各种来源覆盖。 首先列出这些选项的最高优先级来源:
================== ============== ============== ==== ===== 读取偏好 读关注 写关注 排序规则 ================== ============== ====== ======== ========= read_prefs opts opts opts事务 事务 事务 =============== ===================================
在ACID 事务中,opts 中禁止读关注(read concern)和写关注(write concern),并且读取偏好(read preference)必须是主节点 (primary node in the replica set)或 NULL。请参阅事务 和带选项的“distinct”命令的示例。