Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AbstractCursorOptions

Hierarchy继承层级

Index索引

Properties属性

awaitData?: boolean

If awaitData is set to true, when the cursor reaches the end of the capped collection, MongoDB blocks the query thread for a period of time waiting for new data to arrive. 如果awaitData设置为true,当游标到达带上限集合的末尾时,MongoDB会阻塞查询线程一段时间,等待新数据到达。When new data is inserted into the capped collection, the blocked thread is signaled to wake up and return the next batch to the client.当新数据被插入到有上限的集合中时,被阻塞的线程会被通知唤醒并将下一批返回给客户端。

batchSize?: number

Specifies the number of documents to return in each response from MongoDB指定MongoDB每次响应中返回的文档数

bsonRegExp?: boolean

return BSON regular expressions as BSONRegExp instances.返回BSON正则表达式作为BSONRegExp实例。

checkKeys?: boolean

the serializer will check if keys are valid.序列化程序将检查键是否有效。

comment?: unknown

Comment to apply to the operation.要应用于操作的注释。

In server versions pre-4.4, 'comment' must be string. 在4.4之前的服务器版本中,“comment”必须是字符串。A server error will be thrown if any other type is provided.如果提供任何其他类型,将引发服务器错误。

In server versions 4.4 and above, 'comment' can be any valid BSON type.在4.4及以上版本的服务器中,“comment”可以是任何有效的BSON类型。

enableUtf8Validation?: boolean

Enable utf8 validation when deserializing BSON documents. 反序列化BSON文档时启用utf8验证。Defaults to true.默认为true

fieldsAsRaw?: Document

allow to specify if there what fields we wish to return as unserialized raw buffer.允许指定是否存在我们希望作为非序列化原始缓冲区返回的字段。

ignoreUndefined?: boolean

serialize will not emit undefined fields (default:true)序列化不会发出未定义的字段(默认值:true

maxAwaitTimeMS?: number

When applicable maxAwaitTimeMS controls the amount of time subsequent getMores that a cursor uses to fetch more data should take. (ex. cursor.next())在适用的情况下,maxAwaitTimeMS控制游标用于获取更多数据所需的后续getMore时间。(例如cursor.next()

maxTimeMS?: number

When applicable maxTimeMS controls the amount of time the initial command that constructs a cursor should take. (ex. find, aggregate, listCollections)适用时,maxTimeMS控制构造游标的初始命令所需的时间。(例如查找、聚合、列表集合)

noCursorTimeout?: boolean
promoteBuffers?: boolean

when deserializing a Binary will return it as a node.js Buffer instance.当反序列化Binary时,它将作为nodejs Buffer实例返回。

promoteLongs?: boolean

when deserializing a Long will fit it into a Number if it's smaller than 53 bits当反序列化Long时,如果Long小于53位,它将适合Number

promoteValues?: boolean

when deserializing will promote BSON values to their Node.js closest equivalent types.当反序列化将把BSON值提升到它们的Node.js最接近的等效类型时。

raw?: boolean

Return BSON filled buffers from operations从操作返回BSON填充的缓冲区

readConcern?: ReadConcernLike
readPreference?: ReadPreferenceLike
serializeFunctions?: boolean

serialize the javascript functions (default:false).序列化javascript函数(默认值:false)。

session?: ClientSession
tailable?: boolean

By default, MongoDB will automatically close a cursor when the client has exhausted all results in the cursor. 默认情况下,当客户端用尽游标中的所有结果时,MongoDB将自动关闭游标。However, for capped collections you may use a Tailable Cursor that remains open after the client exhausts the results in the initial cursor.但是,对于封顶集合,您可以使用一个Tailable游标,该游标在客户端耗尽初始游标中的结果后保持打开状态。

Generated using TypeDoc