Sets or gets the default captureRejection value for all emitters.设置或获取所有发射器的默认captureRejection值。
This symbol shall be used to install a listener for only monitoring 此符号应用于安装仅用于监控'error'
events.'error'
事件的侦听器。Listeners installed using this symbol are called before the regular 在调用常规'error'
listeners are called.'error'
侦听器之前,将调用使用此符号安装的侦听器。
Installing a listener using this symbol does not change the behavior once an 使用此符号安装侦听器不会在发出'error'
event is emitted, therefore the process will still crash if no regular 'error'
listener is installed.'error'
事件后更改行为,因此如果未安装常规的'error'
侦听器,进程仍将崩溃。
Add a cursor flag to the cursor向游标添加游标标志
The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -.要设置的标志必须是以下['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial']-之一。
The flag boolean value.标志布尔值。
Set the batch size for the cursor.设置游标的批次大小。
The number of documents to return per batch. 每批要返回的文档数。See find command documentation.请参见查找命令文档。
Returns current buffered documents length返回当前缓冲文档的长度
Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance返回此游标的新未初始化副本,其选项与在当前实例上设置的选项匹配
Execute the explain for the cursor对游标执行解释
Iterates over all the documents for this cursor using the iterator, callback pattern.使用迭代器回调模式遍历该游标的所有文档。
The iteration callback.
Add a group stage to the aggregation pipeline将组阶段添加到聚合管道
Add a limit stage to the aggregation pipeline将限制阶段添加到聚合管道
Add a lookup stage to the aggregation pipeline将查找阶段添加到聚合管道
Map all documents using the provided function If there is a transform set on the cursor, that will be called first and the result passed to this function's transform.如果游标上有一个转换集,则使用提供的函数映射所有文档,该转换集将首先被调用,并将结果传递给该函数的转换。
Add a match stage to the aggregation pipeline将匹配阶段添加到聚合管道
Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher)在游标查询上设置maxTimeMS,允许对查询进行硬超时限制(仅在MongoDB 2.6或更高版本上支持)
Number of milliseconds to wait before aborting the query.中止查询前等待的毫秒数。
Get the next available document from the cursor, returns null if no more documents are available.从游标获取下一个可用文档,如果没有更多可用文档,则返回null
。
Add a out stage to the aggregation pipeline将out阶段添加到聚合管道
Add a project stage to the aggregation pipeline将项目阶段添加到聚合管道
Returns current buffered documents返回当前缓冲的文档
Add a redact stage to the aggregation pipeline将修订阶段添加到聚合管道
Rewind this cursor to its uninitialized state. 将游标倒回其未初始化状态。Any options that are present on the cursor will remain in effect. 游标上的任何选项都将保持有效。Iterating this cursor will cause new queries to be sent to the server, even if the resultant data has already been retrieved by this cursor.迭代此游标将导致向服务器发送新的查询,即使结果数据已被此游标检索。
Add a skip stage to the aggregation pipeline将跳过阶段添加到聚合管道
Add a sort stage to the aggregation pipeline向聚合管道添加排序阶段
Returns an array of documents. 返回一个文档数组。The caller is responsible for making sure that there is enough memory to store the results. 调用者负责确保有足够的内存来存储结果。Note that the array only contains partial results when this cursor had been previously accessed. 请注意,当以前访问过该游标时,该数组仅包含部分结果。In that case, cursor.rewind() can be used to reset the cursor.在这种情况下,可以使用cursor.rewind()
重置游标。
Try to get the next available document from the cursor or 尝试从游标获取下一个可用文档,如果返回空批,则返回null
if an empty batch is returnednull
Add a unwind stage to the aggregation pipeline将展开阶段添加到聚合管道
Set the ReadPreference for the cursor.为游标设置ReadPreference
。
Set the ReadPreference for the cursor.为游标设置ReadPreference
。
The new read preference for the cursor.游标的新读取首选项。
Returns a list listener for a specific emitter event name.返回特定发射器事件名称的列表侦听器。
Generated using TypeDoc
The AggregationCursor class is an internal class that embodies an aggregation cursor on MongoDB allowing for iteration over the results returned from the underlying query.AggregationCursor类是一个内部类,它在MongoDB上体现了一个聚合游标,允许对从底层查询返回的结果进行迭代。It supports one by one document iteration, conversion to an array or can be iterated as a Node 4.X or higher stream它支持一个接一个的文档迭代、到数组的转换,或者可以作为Node 4.x或更高的流进行迭代