Class: Mongo::Protocol::KillCursors::Upconverter
- Inherits:
-
Object
- Object
- Mongo::Protocol::KillCursors::Upconverter
- Defined in:
- lib/mongo/protocol/kill_cursors.rb
Overview
Converts legacy insert messages to the appropriare OP_COMMAND style message.
Constant Summary collapse
- KILL_CURSORS =
The kill cursors constant.
'killCursors'.freeze
- CURSORS =
The cursors constant.
'cursors'.freeze
Instance Attribute Summary collapse
-
#collection ⇒ String
readonly
Collection The name of the collection.
-
#cursor_ids ⇒ Array<Integer>
readonly
Cursor_ids The cursor ids.
Instance Method Summary collapse
-
#command ⇒ BSON::Document
Get the upconverted command.
-
#initialize(collection, cursor_ids) ⇒ Upconverter
constructor
Instantiate the upconverter.
Constructor Details
#initialize(collection, cursor_ids) ⇒ Upconverter
Instantiate the upconverter.
110 111 112 113 |
# File 'lib/mongo/protocol/kill_cursors.rb', line 110 def initialize(collection, cursor_ids) @collection = collection @cursor_ids = cursor_ids end |
Instance Attribute Details
#collection ⇒ String (readonly)
Returns collection The name of the collection.
96 97 98 |
# File 'lib/mongo/protocol/kill_cursors.rb', line 96 def collection @collection end |
#cursor_ids ⇒ Array<Integer> (readonly)
Returns cursor_ids The cursor ids.
99 100 101 |
# File 'lib/mongo/protocol/kill_cursors.rb', line 99 def cursor_ids @cursor_ids end |
Instance Method Details
#command ⇒ BSON::Document
Get the upconverted command.
123 124 125 126 127 128 |
# File 'lib/mongo/protocol/kill_cursors.rb', line 123 def command document = BSON::Document.new document.store(KILL_CURSORS, collection) document.store(CURSORS, cursor_ids) document end |