diff --git a/lib/mongo/util/bson_ruby.rb b/lib/mongo/util/bson_ruby.rb index 7c5e72d..d179381 100644 --- a/lib/mongo/util/bson_ruby.rb +++ b/lib/mongo/util/bson_ruby.rb @@ -73,7 +73,7 @@ class BSON_RUBY end def self.serialize_key(buf, key) - raise InvalidDocument, "Key names / regex patterns must not contain the NULL byte" if key.include? 0 + raise InvalidDocument, "Key names / regex patterns must not contain the NULL byte" if key.include? "\x00" self.serialize_cstr(buf, key) end