Class: XGen::Mongo::Driver::UpdateMessage
- Defined in:
- lib/mongo/message/update_message.rb
Constant Summary
Constants inherited from Message
Instance Attribute Summary
Attributes inherited from Message
Instance Method Summary collapse
-
#initialize(db_name, collection_name, sel, obj, repsert) ⇒ UpdateMessage
constructor
A new instance of UpdateMessage.
Methods inherited from Message
#dump, #to_a, #update_message_length, #write_doc, #write_int, #write_long, #write_string
Constructor Details
#initialize(db_name, collection_name, sel, obj, repsert) ⇒ UpdateMessage
Returns a new instance of UpdateMessage.
26 27 28 29 30 31 32 33 |
# File 'lib/mongo/message/update_message.rb', line 26 def initialize(db_name, collection_name, sel, obj, repsert) super(OP_UPDATE) write_int(0) write_string("#{db_name}.#{collection_name}") write_int(repsert ? 1 : 0) # 1 if a repsert operation (upsert) write_doc(sel) write_doc(obj) end |