cursor.allowPartialResults()

On this page本页内容

Definition定义

cursor.allowPartialResults()

mongo Shell Method

This page documents the mongo shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. 本页记录了mongo shell方法,未提及MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。

When used with db.collection.find() operations against a sharded collection, returns partial results, rather than an error, if one or more queried shards are unavailable.与针对分片集合的db.collection.find()操作一起使用时,如果一个或多个查询的分片不可用,则返回部分结果,而不是错误。

Syntax语法

The cursor.allowPartialResults() method has the following syntax:cursor.allowPartialResults()方法语法如下所示:

db.collection.find(<query>, <projection>).allowPartialResults()