Class: XGen::Mongo::Driver::InsertMessage
- Defined in:
- lib/mongo/message/insert_message.rb
Constant Summary
Constants inherited from Message
Instance Attribute Summary
Attributes inherited from Message
Instance Method Summary collapse
-
#initialize(db_name, collection_name, check_keys = true, *objs) ⇒ InsertMessage
constructor
A new instance of InsertMessage.
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, check_keys = true, *objs) ⇒ InsertMessage
Returns a new instance of InsertMessage.
26 27 28 29 30 31 |
# File 'lib/mongo/message/insert_message.rb', line 26 def initialize(db_name, collection_name, check_keys=true, *objs) super(OP_INSERT) write_int(0) write_string("#{db_name}.#{collection_name}") objs.each { |o| write_doc(o, check_keys) } end |