Most notably, this release brings a few incompatible improvements
in the mgo/bson package that brings it up-to-date with the upcoming
Go 1 release. One of the incompatible changes must be handled a
bit more carefully, so please read on.
The release also includes some nice improvements in the replica set
synchronization logic, so depending on your setup it may be worth
upgrading to it sooner.
It may be a bit early to say so, but there's a good chance that the
incompatible changes are over for the time being. The release is
compatible with the Go weekly release 2012-01-20 onwards.
Project details are available at:
The following changes were made in this release:
- The discovery and synchronization of servers was improved to
handle better situations such as when servers are purposefully
added or removed from a replica set while the application is
Thanks to Kyle Banker for clearly describing an edge case due to
which drivers can easily misbehave.
- Getter.GetBSON method must now return an error value. If the error
is not nil, the marshalling procedure is stopped and the error is
returned back to the caller.
This is the most sensitive change in this release. If you have
values with custom bson marshalling logic, please double check
your code for this change since it will continue to compile fine,
but will misbehave if not updated.
- The bson.Timestamp type is gone, and full support for time.Time
has been added. Use time.Time for marshalling and unmarshalling
bson timestamp fields.
The bson.Now function continues to exist, but will now return a
time.Time that has its precision reduced to milliseconds, so that
a roundtrip to the database will not alter the time value.
Using time.Now works fine too, but roundstrips to the database
will truncate the value.
- NewObjectIdSeconds was renamed NewObjectIdWithTime, and now takes
a time.Time as argument:
- The ObjectId.Timestamp method was renamed ObjectId.Time and now
returns a time.Time:
- GridFile.UploadDate now returns a time.Time:
- Documentation improvements. Thanks to Fabian Reinartz for pointing
out a missing change in the previous release
-- I'm not absolutely sure of anything.
The bson.Timestamp type is gone, and full support for time.Time has been added.