Fixed DBRef BSON format.
This commit is contained in:
parent
e1e8452efa
commit
59f32caf57
2
Rakefile
2
Rakefile
|
@ -7,7 +7,7 @@ require 'rake/gempackagetask'
|
|||
require 'rake/contrib/rubyforgepublisher'
|
||||
|
||||
GEM = "mongo"
|
||||
GEM_VERSION = '0.1.1'
|
||||
GEM_VERSION = '0.1.2'
|
||||
SUMMARY = 'Simple pure-Ruby driver for the 10gen Mongo DB'
|
||||
DESCRIPTION = 'This is a simple pure-Ruby driver for the 10gen Mongo DB. For more information about Mongo, see http://www.mongodb.org.'
|
||||
AUTHOR = 'Jim Menard'
|
||||
|
|
|
@ -252,7 +252,7 @@ class BSON
|
|||
end
|
||||
|
||||
def deserialize_dbref_data(buf, key, parent)
|
||||
ns = deserialize_cstr(buf)
|
||||
ns = deserialize_string_data(buf)
|
||||
oid = deserialize_oid_data(buf)
|
||||
XGen::Mongo::Driver::DBRef.new(parent, key, @db, ns, oid)
|
||||
end
|
||||
|
@ -275,9 +275,7 @@ class BSON
|
|||
end
|
||||
|
||||
def serialize_dbref_element(buf, key, val)
|
||||
buf.put(REF)
|
||||
self.class.serialize_cstr(buf, key)
|
||||
self.class.serialize_cstr(buf, val.namespace)
|
||||
serialize_string_element(buf, key, val.namespace, REF)
|
||||
buf.put_array(val.object_id.to_a)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue