Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: MongoCursorInterface::setReadPreference - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MongoCursorInterface::setReadPreference

2025-05-18

MongoCursorInterface::setReadPreference

(PECL mongo >=1.6.0)

MongoCursorInterface::setReadPreferenceSet the read preference for this query

说明

abstract public MongoCursorInterface::setReadPreference ( string $read_preference [, array $tags ] ) : MongoCursorInterface

参数

read_preference

The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.

tags

An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.

返回值

Returns this cursor.

错误/异常

Emits E_WARNING if either parameter is invalid, or if one or more tag sets are provided with the MongoClient::RP_PRIMARY read preference mode.

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mongocursorinterface.setreadpreference.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3