Class: Mongo::Operation::ParallelScan::Result
- Defined in:
- build/ruby-driver-v2.19/lib/mongo/operation/parallel_scan/result.rb
Overview
Defines custom behavior of results in a parallel scan.
Constant Summary collapse
- CURSORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The name of the cursors field in the result.
'cursors'.freeze
Constants inherited from Result
Result::CURSOR, Result::CURSOR_ID, Result::FIRST_BATCH, Result::N, Result::NAMESPACE, Result::NEXT_BATCH, Result::OK, Result::RESULT
Instance Attribute Summary
Attributes inherited from Result
#connection_description, #connection_global_id, #replies
Instance Method Summary collapse
-
#cursor_ids ⇒ Array<Integer>
private
Get all the cursor ids from the result.
-
#documents ⇒ Array<BSON::Document>
Get the documents from parallel scan.
Methods inherited from Result
#acknowledged?, #cluster_time, #cursor_id, #each, #error, #has_cursor_id?, #initialize, #inspect, #labels, #namespace, #ok?, #operation_time, #reply, #returned_count, #snapshot_timestamp, #successful?, #topology_version, #validate!, #write_concern_error?, #written_count
Constructor Details
This class inherits a constructor from Mongo::Operation::Result
Instance Method Details
#cursor_ids ⇒ Array<Integer>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get all the cursor ids from the result.
43 44 45 |
# File 'build/ruby-driver-v2.19/lib/mongo/operation/parallel_scan/result.rb', line 43 def cursor_ids documents.map {|doc| doc[CURSOR][CURSOR_ID]} end |
#documents ⇒ Array<BSON::Document>
Get the documents from parallel scan.
56 57 58 |
# File 'build/ruby-driver-v2.19/lib/mongo/operation/parallel_scan/result.rb', line 56 def documents reply.documents[0][CURSORS] end |