Turn an UNDEFINED type in BSON into a nil in Ruby.

This commit is contained in:
Jim Menard 2009-01-09 15:02:08 -05:00
parent 53fcc027f6
commit 991a75bda7

View File

@ -133,13 +133,13 @@ class BSON
when DATE when DATE
key = deserialize_cstr(@buf) key = deserialize_cstr(@buf)
doc[key] = deserialize_date_data(@buf) doc[key] = deserialize_date_data(@buf)
when NULL when NULL, UNDEFINED
key = deserialize_cstr(@buf) key = deserialize_cstr(@buf)
doc[key] = nil doc[key] = nil
when REF when REF
key = deserialize_cstr(@buf) key = deserialize_cstr(@buf)
doc[key] = deserialize_dbref_data(@buf) doc[key] = deserialize_dbref_data(@buf)
when BINARY, UNDEFINED, SYMBOL, CODE_W_SCOPE when BINARY, SYMBOL, CODE_W_SCOPE
# TODO # TODO
raise "unimplemented type #{type}" raise "unimplemented type #{type}"
when EOO when EOO