发布于 2015-09-14 14:58:59 | 179 次阅读 | 评论: 0 | 来源: 网络整理
参数: |
|
---|
Append the readPref() to a cursor to control how the client will route the query will route to members of the replica set.
The mode string should be one of:
The tagSet parameter, if given, should consist of an array of tag set objects for filtering secondary read operations. For example, a secondary member tagged { dc: 'ny', rack: 2, size: 'large' } will match the tag set { dc: 'ny', rack: 2 }. Clients match tag sets first in the order they appear in the read preference specification. You may specify an empty tag set {} as the last element to default to any available secondary. See the tag sets documentation for more information.
注解
You must apply cursor.readPref() to the cursor before retrieving any documents from the database.