- #44 Fixed regexp deserialization in conjunction with SSL io. (Niels Ganser)
- RUBY-1024 Fixed Hash#merge only to yield when keys exist in both hashes. (Agis Anastasopoulos)
- RUBY-1019 Performace improvements on deserialization.
-
#41 Normalizing arrays does not mutate. (Agis Anastasopoulos)
-
#40 Added big endian support. (Jeff Blight)
#39 Fixed MD5 hashing of hostname in c extension. (James Hudon)
- RUBY-950 Don't encode to UTF-8 in Binary#to_bson, only force BINARY encoding.
- Add
BSON.ObjectIdconstructor for instantiating an ObjectId from a String. Update ObjectId#inspect to print out a string that can be evaluated into the corresponding ObjectId. (Tony Ta)
- RUBY-950 Encode to UTF-8 then force BINARY encoding in Binary#to_bson.
- Fixed argument errors when delegating to regex objects. (Tom Scott)
BSON::Regexp::Rawnow behaves like a regularRegexpby delegating to the compiled and wrapped regex. (Tom Scott)
- Fixed
inspectonBSON::Binaryto handle ASCII characters. (Jérémy Carlier)
- Fixed
BSON::ObjectId.legal?regular expression to properly check beginning and end of strings.
- #31 Fix Int64 decode from strings. (Nobuyoshi Nakada)
- RUBY-898 Compensated for different return values of Socket#readbyte and OpenSSL::SSL::SSLSocket#readbyte.
- Fixed installation on latest Rubygems which requires
'date'to be required.
-
RUBY-852 Regular expressions that are deserialized now return a
BSON::Regexp::Rawinstead of aRegexpobject. In order to get the regular expression compiled, call#compileon the returned object.raw.compile
BSON::Binarynow implements#inspectwith a truncated view of the data for better readability.
-
The native object id generation was fixed to match the raw Ruby. (Conrad Irwin)
-
#23:
BSON::Binarytypes can be now used as hash keys. (Adam Wróbel)
- Fixed native C encoding of strings and performace on Rubinius.
-
#17: Fixed
BSON::ObjectIdcounter increment on Ruby 2.1.0 since method names can no longer override Ruby keywords. -
#16: Fixed serialization of times when microseconds are causing
to_fon time to be 1 microsecond inaccurate. (Francois Bernier)
- #15:
DateandDateTimeinstances now return theTimevalue for the BSON type, so that they can be serialized inside hashes and arrays. (Michael Sell)
- Ruby 1.8 interpreters are no longer supported.
- #14:
Fixed all 1.8 errors related to
DateTimeserialization.
- #13 /
RUBY-714:
Require time in
DateTimemodules when using outside of environments that don't already have time included.
DateandDateTimeobjects in Ruby can now be serialized into BSON.Dateis converted to a UTCTimeat midnight and serialized, whileDateTimeis simply converted to the identicalTimebefore serialization. Note that these objects will be deserialized intoTimeobjects.
-
BSON::DEFAULT_MAX_BSON_SIZEhas been removed, as the BSON specification does not provide an upper limit on how large BSON documents can be. -
BSON.serializeis no longer the entry point to serialize a BSON document into its raw bytes.For Ruby runtimes that support ordered hashes, you may simply call `to_bson` on the hash instance (Alternatively a `BSON::Document` is also a hash: { key: "value" }.to_bson BSON::Document[:key, "value"].to_bson For Ruby runtimes that do not support ordered hashes, then you must instantiate an instance of a `BSON::Document` (which is a subclass of hash) and call `to_bson` on that, since the BSON specification guarantees order of the fields: BSON::Document[:key, "value"].to_bson -
BSON.deserializeis no longer the entry point for raw byte deserialization into a document.For Ruby runtimes that support ordered hashes, you may simply call `from_bson` on the `Hash` class if you want a `Hash` instance, or on `BSON::Document` if you want an instance of that. The input must be a `StringIO` object: Hash.from_bson(stringio) BSON::Document.from_bson(stringio) For Ruby runtimes that do not support ordered hashes, then `from_bson` must be called on `BSON::Document` in order to guarantee order: BSON::Document.from_bson(stringio) -
Calling
to_jsonon custom BSON objects now outputs different results from before, and conforms the BSON specification:BSON::Binary:{ "$binary" : "\x01", "$type" : "md5" }BSON::Code:{ "$code" : "this.v = 5 }BSON::CodeWithScope:{ "$code" : "this.v = value", "$scope" : { v => 5 }}BSON::MaxKey:{ "$maxKey" : 1 }BSON::MinKey:{ "$minKey" : 1 }BSON::ObjectId:{ "$oid" : "4e4d66343b39b68407000001" }BSON::Timestamp:{ "t" : 5, "i" : 30 }Regexp:{ "$regex" : "[abc]", "$options" : "i" }
-
All Ruby objects that have a corresponding object defined in the BSON specification can now have
to_bsoncalled on them to get the raw BSON bytes. These objects include:ArrayFalseClassFloatHashIntegerNilClassRegexpStringSymbol(deprecated)TimeTrueClass
-
Custom types specific to the BSON specification that have Ruby objects defined for them may also have
to_bsoncalled on them to get the raw bytes. These types are:BSON::BinaryBSON::CodeBSON::CodeWithScopeBSON::MaxKeyBSON::MinKeyBSON::ObjectIdBSON::TimestampBSON::Undefined