lib/mongo/message/message.rb in mongodb-mongo-0.8 vs lib/mongo/message/message.rb in mongodb-mongo-0.9
- old
+ new
@@ -34,11 +34,11 @@
@message_length = HEADER_SIZE
@data_length = 0
@request_id = (@@class_req_id += 1)
@response_id = 0
@buf = ByteBuffer.new
-
+
@buf.put_int(16) # holder for length
@buf.put_int(@request_id)
@buf.put_int(0) # response_to
@buf.put_int(op)
end
@@ -56,11 +56,11 @@
def write_string(s)
BSON.serialize_cstr(@buf, s)
update_message_length
end
- def write_doc(hash)
- @buf.put_array(BSON.new.serialize(hash).to_a)
+ def write_doc(hash, check_keys=false)
+ @buf.put_array(BSON.new.serialize(hash, check_keys).to_a)
update_message_length
end
def to_a
@buf.to_a