class Mongo::Protocol::KillCursors::Upconverter
Converts legacy insert messages to the appropriare OP_COMMAND style message.
@since 2.1.0
Constants
- CURSORS
The cursors constant.
@since 2.2.0
- KILL_CURSORS
The kill cursors constant.
@since 2.2.0
Attributes
collection[R]
@return [ String ] collection The name of the collection.
cursor_ids[R]
@return [ Array<Integer> ] cursor_ids
The cursor ids.
Public Class Methods
new(collection, cursor_ids)
click to toggle source
Instantiate the upconverter.
@example Instantiate the upconverter.
Upconverter.new('users', [ 1, 2, 3 ])
@param [ String ] collection The name of the collection. @param [ Array<Integer> ] cursor_ids
The cursor ids.
@since 2.1.0
# File lib/mongo/protocol/kill_cursors.rb, line 113 def initialize(collection, cursor_ids) @collection = collection @cursor_ids = cursor_ids end
Public Instance Methods
command()
click to toggle source
Get the upconverted command.
@example Get the command.
upconverter.command
@return [ BSON::Document ] The upconverted command.
@since 2.1.0
# File lib/mongo/protocol/kill_cursors.rb, line 126 def command document = BSON::Document.new document.store(KILL_CURSORS, collection) document.store(CURSORS, cursor_ids) document end