Class: Monga::Protocol::Insert
- Defined in:
- lib/monga/protocol/insert.rb
Constant Summary collapse
- FLAGS =
{ continue_on_error: 0, }
Constants inherited from Request
Instance Attribute Summary
Attributes inherited from Request
Instance Method Summary collapse
Methods inherited from Request
#callback_perform, #command, #header, #initialize, #parse_response, #perform
Constructor Details
This class inherits a constructor from Monga::Request
Instance Method Details
#body ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/monga/protocol/insert.rb', line 9 def body @body ||= begin documents = @options[:documents] msg = ::BinUtils.append_int32_le!(nil, flags) msg << full_name << Monga::NULL_BYTE case documents when Array documents.each do |doc| msg << doc.to_bson end when Hash msg << documents.to_bson end msg end end |