Class: Monga::Protocol::Delete

Inherits:
Request
  • Object
show all
Defined in:
lib/monga/protocol/delete.rb

Constant Summary collapse

FLAGS =
{ 
  single_remove: 0,
}

Constants inherited from Request

Request::OP_CODES

Instance Attribute Summary

Attributes inherited from Request

#connection, #request_id

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

#bodyObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/monga/protocol/delete.rb', line 9

def body
  @body ||= begin
    query = @options[:query]

    msg = ::BinUtils.append_int32_le!(nil, 0)
    msg << full_name << Monga::NULL_BYTE
    ::BinUtils.append_int32_le!(msg, flags)
    msg << query.to_bson
    msg
  end
end