类:Mongo::Operation::ParallelScan::Result

继承:
操作::结果
  • 对象
显示全部
定义于:
lib/ Mongo/operation/parallel_scan/result.rb

Overview

定义并行扫描中结果的自定义行为。

由于:

  • 2.0.0

常量摘要折叠

CURSORS =

此常量是私有 API 的一部分。 应尽可能避免使用此常量,因为它将来可能会被删除或更改。

结果中游标字段的名称。

由于:

  • 2.0.0

'cursors'

实例方法摘要折叠

实例方法详细信息

# cursor_id = "Array<Integer>"

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

从结果中获取所有游标 ID。

例子:

获取游标 ID。

result.cursor_ids

返回:

  • ( Array<Integer> )

    游标ID。

由于:

  • 2.0.0



40
41
42
# File 'lib/ Mongo/operation/parallel_scan/result.rb', line 40

def cursor_id
  文档.map { |doc| doc[游标][CURSOR_ID] }
end

# 个documentsArray<BSON::Document>

从并行扫描中获取文档。

例子:

获取文档。

result.documents

返回:

  • ( Array<BSON::Document> )

    文档。

由于:

  • 2.0.0



53
54
55
# File 'lib/ Mongo/operation/parallel_scan/result.rb', line 53

def 文档
  回复.文档[0][游标]
end