Class Mongo::Protocol::Insert::Upconverter
In: lib/mongo/protocol/insert.rb
Parent: Object

Converts legacy insert messages to the appropriare OP_COMMAND style message.

@since 2.1.0

Methods

command   new  

Constants

INSERT = 'insert'.freeze   Insert field constant.

@since 2.1.0

DOCUMENTS = 'documents'.freeze   Documents field constant.

@since 2.1.0

WRITE_CONCERN = 'writeConcern'.freeze   Write concern field constant.

@since 2.1.0

Attributes

collection  [R]  @return [ String ] collection The name of the collection.
documents  [R]  @return [ Array<BSON::Document> ] documents The documents to insert.
options  [R]  @return [ Hash ] options The options.

Public Class methods

Instantiate the upconverter.

@example Instantiate the upconverter.

  Upconverter.new('users', documents)

@param [ String ] collection The name of the collection. @param [ Array<BSON::Document> ] documents The documents. @param [ Hash ] options The options.

@since 2.1.0

Public Instance methods

Get the upconverted command.

@example Get the command.

  upconverter.command

@return [ BSON::Document ] The upconverted command.

@since 2.1.0

[Validate]