Greetings,
Release r2013.04.05 of the mgo MongoDB driver for Go is out
with several fixes and improvements.
Details about the driver may be found in its web page:
http://labix.org/mgo
The following changes were made in this release:
- Fixed test case to adapt to minor differences in MongoDB 2.4. All
of the test suite works with 2.4, and continues to work with
earlier versions.
- New Iter.Close method. Close kills the server cursor used by the
iterator, if any, and returns nil if no errors happened during
iteration, or the actual error otherwise.
Server cursors are automatically closed at the end of an iteration,
which means close will do nothing unless the iteration was
interrupted before the server finished sending results to the
driver. If Close is not called in such a situation, the cursor
will remain available at the server until the default cursor
timeout period is reached. No further problems arise.
More details about the behavior at:
http://labix.org/v2/mgo#Iter.Close
- New Database.UpsertUser method and accompanying constants and types
to handle the new role-based permissions introduced 2.4+. The method
Database.AddUser still works in new databases that haven't explicitly
disabled the old user document format, but should be replaced as it
will eventually be dropped.
More details about the method and feature at:
http://labix.org/v2/mgo#Database.UpsertUser
- Fixed concurrency issue when acquiring socket, detected in
collaboration with Roger Peppe.
- Fixed race condition in the machine id initalization performed
during the first call to bson.ObjectId, provided by Roger Peppe.
- Improve IsDup so it handles all known variations of index key
duplication, this time via server code inspection. Problem
reported by Evan Shaw.
- Add Query.LogReplay method, as requested by Daniel Gottlieb.
- Clarified documentation of GridFS.Open* methods to mention
these files are for reading only, as suggested by Lars Conrad.
- Allow direct connection to replica set member in unknown state.
Problem reported by Sam Helman.
- Added test case to confirm authentication works on sharded setups,
including in harsh cases such as a lost primary. Scenario suggested
by Travis Reeder.
- The *Session values have lost the use of SetFinalizer. This helps
the garbage collector to free these values more timely, in exchange
for not trying to help with broken code that isn't closing sessions.
gustavo @
http://niemeyer.net