Class Mongo::Protocol::Reply::Upconverter
In: lib/mongo/protocol/reply.rb
Parent: Object

Upconverts legacy replies to new op command replies.

@since 2.1.0

Methods

command   new  

Constants

NEXT_BATCH = 'nextBatch'.freeze   Next batch constant.

@since 2.1.0

FIRST_BATCH = 'firstBatch'.freeze   First batch constant.

@since 2.1.0

CURSOR = 'cursor'.freeze   Cursor field constant.

@since 2.1.0

ID = 'id'.freeze   Id field constant.

@since 2.1.0

Attributes

cursor_id  [R]  @return [ Integer ] cursor_id The cursor id.
documents  [R]  @return [ Array<BSON::Document> ] documents The documents.
starting_from  [R]  @return [ Integer ] starting_from The starting point in the cursor.

Public Class methods

Initialize the new upconverter.

@example Create the upconverter.

  Upconverter.new(docs, 1, 3)

@param [ Array<BSON::Document> ] documents The documents. @param [ Integer ] cursor_id The cursor id. @param [ Integer ] starting_from The starting position.

@since 2.1.0

Public Instance methods

Get the upconverted command.

@example Get the command.

  upconverter.command

@return [ BSON::Document ] The command.

@since 2.1.0

[Validate]