MongoCursor::partial

(PECL mongo >=1.2.0)

MongoCursor::partialIf this query should fetch partial results from mongos if a shard is down

说明

public MongoCursor::partial ([ bool $okay = TRUE ] ) : MongoCursor

This option allows mongos to send partial query results if a shard is unreachable. This is only applicable when running a sharded MongoDB cluster and connecting to a mongos.

If a shard goes down and a query needs to be sent to that shard, mongos will return the results (if any) from shards it already contacted, then an error message that it could not reach the shard (a MongoCursorException in PHP). If you would like to get whatever results mongos can provide and no exception, you can use this method. Note that this means that you won't have an indication that a shard is down in your query response.

This has no effect on the query if all shards are reachable. This flag was implemented in MongoDB version 1.7.5, so will only work with that version and higher.

参数

okay

If receiving partial results is okay.

返回值

Returns this cursor.

错误/异常

Throws MongoCursorException if this cursor has started iterating.

相关文章
php dbx 函数 send a query and fetch all results if any php firebird/interbase 函数 fetch a result row from a query as an associative arrayphp maxdb 函数 check if there any more query results from a multi queryphp maxdb 函数 fetch results from a prepared statement into the bound variablesphp odbc 函数 checks if multiple results are availablephp mongocommandcursor checks if there are results that have not yet been sent from the databasephp mongocursor counts the number of results for this queryphp mongocursor checks if there are results that have not yet been sent from the databasephp mongocursor gives the database a hint about the queryphp mongocursor if this query should fetch partial results from mongos if a shard is downphp mongocursor sets whether this cursor will be left open after fetching the last resultsphp mongocursor sets a client side timeout for this queryphp mongocursorinterface checks if there are results that have not yet been sent from the databasephp mysqli stmt fetch results from a prepared statement into the bound variablesphp mysqli stmt check if there are more query results from a multiple queryphp mysqlnduhconnection check if there are any more query results from a multi queryphp mysqlnduhconnection get result from async queryphp sdo das relational 函数 executes a given sql query against a relational database and returns the results as a normalised data graphphp solrquery allows grouping results based on the unique values of a function query group.func parameter php solrquery if true solr includes the number of groups that have matched the query in the results
关注编程学问公众号