Class: Mongo::Protocol::Reply::Upconverter
- Inherits:
-
Object
- Object
- Mongo::Protocol::Reply::Upconverter
- Defined in:
- build/ruby-driver-v2.19/lib/mongo/protocol/reply.rb
Overview
Upconverts legacy replies to new op command replies.
Constant Summary collapse
- NEXT_BATCH =
Next batch constant.
'nextBatch'.freeze
- FIRST_BATCH =
First batch constant.
'firstBatch'.freeze
- CURSOR =
Cursor field constant.
'cursor'.freeze
- ID =
Id field constant.
'id'.freeze
Instance Attribute Summary collapse
-
#cursor_id ⇒ Integer
readonly
Cursor_id The cursor id.
-
#documents ⇒ Array<BSON::Document>
readonly
Documents The documents.
-
#starting_from ⇒ Integer
readonly
Starting_from The starting point in the cursor.
Instance Method Summary collapse
-
#command ⇒ BSON::Document
Get the upconverted command.
-
#initialize(documents, cursor_id, starting_from) ⇒ Upconverter
constructor
Initialize the new upconverter.
Constructor Details
#initialize(documents, cursor_id, starting_from) ⇒ Upconverter
Initialize the new upconverter.
152 153 154 155 156 |
# File 'build/ruby-driver-v2.19/lib/mongo/protocol/reply.rb', line 152 def initialize(documents, cursor_id, starting_from) @documents = documents @cursor_id = cursor_id @starting_from = starting_from end |
Instance Attribute Details
#cursor_id ⇒ Integer (readonly)
Returns cursor_id The cursor id.
162 163 164 |
# File 'build/ruby-driver-v2.19/lib/mongo/protocol/reply.rb', line 162 def cursor_id @cursor_id end |
#documents ⇒ Array<BSON::Document> (readonly)
Returns documents The documents.
159 160 161 |
# File 'build/ruby-driver-v2.19/lib/mongo/protocol/reply.rb', line 159 def documents @documents end |
#starting_from ⇒ Integer (readonly)
Returns starting_from The starting point in the cursor.
165 166 167 |
# File 'build/ruby-driver-v2.19/lib/mongo/protocol/reply.rb', line 165 def starting_from @starting_from end |
Instance Method Details
#command ⇒ BSON::Document
Get the upconverted command.
175 176 177 |
# File 'build/ruby-driver-v2.19/lib/mongo/protocol/reply.rb', line 175 def command command? ? op_command : find_command end |