Class: Mongo::Operation::Commands::ParallelScan::Result
- Defined in:
- lib/mongo/operation/commands/parallel_scan/result.rb
Overview
Defines custom behaviour of results in a parallel scan.
Constant Summary collapse
- CURSORS =
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
Instance Method Summary collapse
-
#cursor_ids ⇒ Array<Integer>
Get all the cursor ids from the result.
-
#documents ⇒ Array<BSON::Document>
Get the documents from parallel scan.
Methods inherited from Result
#acknowledged?, #cursor_id, #each, #initialize, #inspect, #multiple?, #namespace, #ok?, #reply, #returned_count, #successful?, #validate!, #written_count
Constructor Details
This class inherits a constructor from Mongo::Operation::Result
Instance Method Details
#cursor_ids ⇒ Array<Integer>
Get all the cursor ids from the result.
39 40 41 |
# File 'lib/mongo/operation/commands/parallel_scan/result.rb', line 39 def cursor_ids documents.map{ |doc| doc[CURSOR][CURSOR_ID] } end |
#documents ⇒ Array<BSON::Document>
Get the documents from parallel scan.
51 52 53 |
# File 'lib/mongo/operation/commands/parallel_scan/result.rb', line 51 def documents reply.documents[0][CURSORS] end |