Docs HomeMongoDB Manual

cursor.allowPartialResults()

On this page本页内容

Definition定义

cursor.allowPartialResults()
Important

mongosh Method

This page documents a mongosh method. This is not the documentation for a language-specific driver, such as Node.js.

For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.

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()