Releases: mongodb/mongo-go-driver
MongoDB Go Driver 1.0.3
The MongoDB Go driver team is pleased to release version 1.0.3 of the official Go driver.
This release contains several bug fixes. Please refer to the Jira issues below for more information.
Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Release Notes
Bug
- [GODRIVER-1012] - Downloading big files from gridfs ends with ErrWrongSize
- [GODRIVER-1016] - Get current op on MongoDB 2.6
- [GODRIVER-1068] - Need to call ping in Ping()
- [GODRIVER-1078] - Allow specifying empty value for connection URI readPreferenceTags option
- [GODRIVER-1086] - Can leak creds through errors from URI Parsing
MongoDB Go Driver 1.0.2
The MongoDB Go driver team is pleased to release version 1.0.2 of the official Go driver.
This release contains several bug fixes. Please refer to the Jira issues below for more information.
Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Release Notes
Bug
- [GODRIVER-867] - options.FindOptions.SetLimit() docs suggest negative limits are still supported, but they're not
- [GODRIVER-975] - bulk write doesn't report write concern error
- [GODRIVER-983] - extjson date parser doesn't work for dates after the year 2262
- [GODRIVER-989] - ChangeStream Next nil Pointer Dereference
- [GODRIVER-1005] - Decoding SingleResult or cursor to nil pointer type panics
Improvement
- [GODRIVER-1004] - SingleResult.Decode only works once
MongoDB Go Driver 1.0.1
The MongoDB Go driver team is pleased to release version 1.0.1 of the official Go driver.
This release fixes a race condition in handshaking, panics in GridFS, and improves documentation. Additionally, some small API changes have been made.
Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Release Notes
Bug
- [GODRIVER-809] - Go driver cannot decode gridfs files collection documents if the length field is not stored as int64
- [GODRIVER-880] - Cannot query when having a regular expression in MongoDB Document
- [GODRIVER-881] - ObjectID should be quoted in bsoncore.Value's String() method
- [GODRIVER-884] - Default for timestamps is a zero'd *time.Location, instead of `nil`
- [GODRIVER-886] - Panic when passing non-ObjectID file ID to bucket.OpenDownloadStream
- [GODRIVER-887] - Panic when passing in UploadOptions with Metadata but no Registry to bucket.OpenUploadStream
- [GODRIVER-888] - GoDoc out of date for cursor example
- [GODRIVER-893] - bsonrw.valueReader skip does not properly skip regular expressions
- [GODRIVER-898] - Topology should synchronously update ServerDescriptions
- [GODRIVER-900] - Server string representation typo: Avergage RTT
- [GODRIVER-901] - Race detector flagged race
- [GODRIVER-908] - options.MergeClientOptions doesn't handle errors properly
- [GODRIVER-910] - panic when calling Watch on a Client that has not been connected
- [GODRIVER-956] - Legacy Find is not respecting limit
New Feature
- [GODRIVER-873] - BulkWriteResult from BulkWrite doesn't have errors in unordered bulk
Improvement
- [GODRIVER-864] - Upgrade testing to go 1.12
- [GODRIVER-896] - Document Docker DNS issue
MongoDB Go Driver 1.0.0
The MongoDB Go driver team is pleased to release version 1.0.0 of the official Go driver.
This release fixes retryable writes for batch split write commands and fixes documentation errors.
Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Release Notes
Bug
- [GODRIVER-871] - Retryable Writes is broken for batch splits
New Feature
- [GODRIVER-790] - Drivers should use majority write concern when retrying commitTransaction
- [GODRIVER-844] - Resync transaction spec tests for bulk write error reporting change
MongoDB Go Driver 1.0.0 Release Candidate 2
The MongoDB Go driver team is pleased to release v1.0.0-rc2 of the official Go driver.
This release fixes zlib compression and contains several smaller bug fixes.
Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Using Dep
If you are using `dep` to retrieve the Go driver, please ensure that dep has pinned the correct version. The `dep` tool prefers released versions over pre-release versions, so it is likely that `dep` will retrieve version `0.3.0` instead of `1.0.0-rc2`. You can use the command below to retrieve the correct version.dep ensure -add "go.mongodb.org/mongo-driver/mongo@>=1.0.0-rc1"
Release Notes
Bug
- [GODRIVER-836] - zLib compression does not work
- [GODRIVER-840] - Docs out of date for how to connect
- [GODRIVER-848] - bson can not marshal datetime ISODate json correct
- [GODRIVER-856] - Chunks collection files_id_1_n_1 index not unique
New Feature
- [GODRIVER-698] - Support for GSSAPI "ServiceHost"
MongoDB Go Driver 1.0.0 Release Candidate 1
The MongoDB Go driver team is pleased to release v1.0.0-rc1 of the official Go driver.
This release changes the import path for the driver from github.com/mongodb/mongo-go-driver
to go.mongodb.org/mongo-driver
. If you have previously downloaded the driver you will need to move it to the new location within your GOPATH.
Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
New Import Path
The base import path for the driver has changed. The new path isgo.mongodb.org/mongo-driver
. Package locations under the import path remain the same, e.g. the mongo
package is located under go.mongodb.org/mongo-driver/mongo
.
mongo.Client
Creation
The mongo.Client
construction functions no longer take a string URI parameter. Instead, a MongoDB URI can be provided as an option.
Previous API: mongo.NewClient("mongodb://localhost:27017/")
New API: mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017/"))
Release Notes
Bug
- [GODRIVER-767] - client.Disconnect(nil) causes a panic
- [GODRIVER-768] - documentation example test failing
- [GODRIVER-789] - Deprecated Count method is still in the public API
- [GODRIVER-802] - Document fields corrupted in transformAndEnsureID
- [GODRIVER-805] - BSON field '$changeStream.maxAwaitTimeMS' is an unknown field
- [GODRIVER-811] - Modify change stream test to only run if WireVersion < 8
- [GODRIVER-812] - Server String() function access unprotected variables
- [GODRIVER-813] - Aggregate Test Failing
- [GODRIVER-815] - Can only interact with GridFS files by id via ObjectIds
- [GODRIVER-817] - Fix killCursor helper in collection tests
- [GODRIVER-819] - driver.KillCursors broken
- [GODRIVER-831] - GSSAPI Authentication starts SASL conversation wrong
- [GODRIVER-833] - GridFS default chunk size is 255 kB, not 255 KiB
- [GODRIVER-839] - GoDoc for mongo.Client does not match API
- [GODRIVER-846] - Unable to authenticate to a replica set member using the keyfile
New Feature
- [GODRIVER-524] - Implement SDAM Error Handling
- [GODRIVER-775] - Cannot parse MongoDB Extended JSON from mongoexport
- [GODRIVER-803] - Add option to allow authenticating with an arbiter
Task
- [GODRIVER-194] - Add pipeline stage to ChangeStreams example for Docs
- [GODRIVER-422] - Provide Transactions example for Docs
- [GODRIVER-788] - Update Transactions Retry Example 3 to include read preference
Improvement
- [GODRIVER-120] - Alternative Import Path
- [GODRIVER-572] - TransformDocument should document how it handles nil
- [GODRIVER-600] - Add test that read operations ignore db/collection readConcern in transaction
- [GODRIVER-727] - Clean up mongo.newClient
- [GODRIVER-731] - Maps inside structs are not zeroed
- [GODRIVER-747] - Allow TLSConfig as a client option
- [GODRIVER-787] - Make file should run documentation examples
- [GODRIVER-793] - Remove all public use of 'x' packages in the options package
- [GODRIVER-800] - Modify BatchCursor to return batch as a single slice of documents
- [GODRIVER-807] - Add attribution for Gopher logo
- [GODRIVER-828] - Create mongo.CommandError to wrap command.Error
MongoDB Go Driver Beta 3
The MongoDB Go driver team is pleased to release the third and final beta release of the official Go driver.
This release changes the API for cursor, numerous documentation updates and fixes, and other small API changes.
Documentation can be found on GoDoc and the MongoDB documentation site. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Cursor and ChangeStream API changed
This release changes themongo.Cursor
type from an interface
to a struct
and adds a mongo.ChangeStream
struct
type which is returned from Watch
methods. The DecodeBytes
method on each has been replaced with a struct level property called Current
. The bson.Raw bytes of this property are only valid until the next call to Next
or Close
on the Cursor
or ChangeStream
.
Previous usage:
var cur mongo.Cursor
for cur.Next(context.TODO()) {
rdr, err := cur.DecodeBytes()
if err != nil {
return err
}
// Do something with rdr
}
New usage:
var cur *mongo.Cursor
for cur.Next(context.TODO()) {
rdr := cur.Current
// Do something with rdr
}
Release Notes
Bug
- [GODRIVER-743] - UpdateOne and UpdateMany should return error when update parameter is of zero length
- [GODRIVER-746] - ChangeStream Next doesn't getMore after error case
- [GODRIVER-756] - Incorrect formatting of numbers with exponents in JSON
- [GODRIVER-757] - README out of date WRT using nil in Find
- [GODRIVER-769] - Remove use of internal package from connstring package
- [GODRIVER-784] - GridFS RoundTrip test fails with race detector on
- [GODRIVER-791] - Panic on cursor Close with a dead server
New Feature
- [GODRIVER-400] - reorder conditionals to return write errors if a write concern error is also present.
- [GODRIVER-758] - options.Collation is missing Normalization
Task
- [GODRIVER-754] - Improve test coverage for GridFS
Improvement
- [GODRIVER-3] - Change driver.Cursor to be a batch cursor
- [GODRIVER-704] - Document that mongo.SessionContext is not goroutine safe
- [GODRIVER-707] - method/operation to determine if a write error is a duplicate key error
- [GODRIVER-713] - Remove string key restriction for Encoder and Decoder lookups
- [GODRIVER-714] - KeepAlive is not enabled by default
- [GODRIVER-717] - IntEncodeValue should encode int's within 32bits as int32s
- [GODRIVER-733] - Add diagnostic information to server selection errors
- [GODRIVER-751] - Incorrect example in godoc website
- [GODRIVER-753] - Change GridFS implementation to not have partial chunks
- [GODRIVER-759] - Make Cursor a struct and make changeStream public
- [GODRIVER-764] - bulk write operation dependencies
- [GODRIVER-772] - README requirements section still lists v3.2 as minimum version
- [GODRIVER-781] - Inconsistent use of time.Duration and int64 in options
MongoDB Go Driver Beta 2
The MongoDB Go driver team is pleased to release the second beta release of the official Go driver.
This release fixes a number of API and functionality bugs within the driver and includes support for MongoDB server versions 2.6 and 3.0.
Documentation can be found on GoDoc and the MongoDB documentation site. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Legacy Server Support
This release adds support for MongoDB server versions 2.6 and 3.0. This brings the supported range of MongoDB server versions to 2.6 to 4.0 inclusive.Release Notes
Bug
- [GODRIVER-641] - Connect direct to a replica set member also requires ReadPreference to be set
- [GODRIVER-659] - Collection allows insertion of a nil value
- [GODRIVER-660] - _id should be prepended, not appended
- [GODRIVER-667] - Default write concern should not be appended.
- [GODRIVER-668] - Write concern should not be encoded for certain commands based on wire version.
- [GODRIVER-675] - Nil pointer implementing Zeroer interface should not cause panic
- [GODRIVER-676] - Panic marshaling a nil ObjectID
- [GODRIVER-679] - Aggregate does not accept a bson.A as the pipeline
- [GODRIVER-681] - Cursors and SingleResult ignore client custom registry
- [GODRIVER-688] - ClientOptions.SetSSL() records some string options as being set even if they're empty strings
- [GODRIVER-691] - ArrayEncodeValue and SliceEncodeValue don't properly handle nil for primitive.Element
- [GODRIVER-692] - SingleResult.Decode to struct panics with nil pointer dereference
- [GODRIVER-693] - Opening a change stream cursor for any database gives error
- [GODRIVER-694] - UnmarshalExtJSON panics with invalid json
- [GODRIVER-696] - SingleResult should use bson.DefaultRegistry when Registry is nil
- [GODRIVER-697] - nil panics being encoded via bson.Marshal
- [GODRIVER-699] - Decoding into a bson.M embeds bson.Ds, not bson.Ms
- [GODRIVER-700] - JSON scanner fails when underlying reader reads less than the requested bytes and also returns io.EOF
- [GODRIVER-701] - ReadPreference on client is not respected
- [GODRIVER-708] - bsonx package is exposed in the public API of some stable packages
- [GODRIVER-710] - Unmarshaling to a interface{} fails
- [GODRIVER-715] - driver.KillCursors does not close connection
- [GODRIVER-719] - Map Decoder should support non-primitive string types
- [GODRIVER-724] - Downloading files from gridfs does not match uploaded data
- [GODRIVER-725] - Numbers that look like integers but are too big should be treated as doubles
- [GODRIVER-726] - Server.heartbeat uses no timeouts
- [GODRIVER-735] - ListCollections does not use read preference primary
- [GODRIVER-741] - Option "serverSelectionTimeoutMS" is ignored if set in connection URI
Epic
- [GODRIVER-138] - Add support for legacy servers
New Feature
- [GODRIVER-109] - Implement legacy OP_QUERY, OP_GET_MORE and OP_KILL_CURSORS
- [GODRIVER-492] - Implement legacy collection enumeration
- [GODRIVER-677] - Alias needed in bson package for primitive.E
- [GODRIVER-742] - Supported parsing extended JSON containing $date without $numberLong
Improvement
- [GODRIVER-279] - Implement legacy index enumeration
- [GODRIVER-581] - Add documentation for new bsoncodec package
- [GODRIVER-663] - Extend the Marshal* and Unmarshal* family functions with *WithContext functions
- [GODRIVER-665] - Support only "automatic" and "direct" as values for "connect" URI option
- [GODRIVER-669] - Reverse Dependencies between bson and bsonx
- [GODRIVER-683] - Make CommandMetadata struct private inside connection.go
- [GODRIVER-729] - Add IndexOptions struct to use as the type of IndexModel.Options
MongoDB Go Driver Beta 1
The MongoDB Go driver team is pleased to release the first beta release of the official Go driver.
This release updates the BSON codec system, changes the location of various types in the BSON library, and contains a restructure of the repository. This release contains a stability guarantee for the packages not under the x directory.
Documentation can be found on GoDoc and the MongoDB documentation site. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
Repository Structure & Stability
This release comes with the first set of stabilizing APIs. Unless significant issues are found with stabilizing APIs, they will not be changed between this beta and the first major release of this driver. The packages have been restructured to better indicate which packages are stabilizing and which are not. Libraries under the x
directory do not follow a stability guarantee and may change significantly in the future.
BSON Codec System
The BSON codec system has been improved to be more flexible and extensible. The primitive
package has gained the D
, M
, and A
types, which are used by default when decoding into an interface{}
.
Release Notes
Bug
- [GODRIVER-409] - bson decoder should not zero entire struct before beginning unmarshalling
- [GODRIVER-464] - nil check of cursor missing in changeStream Close function
- [GODRIVER-588] - Cannot decode pointers to nil / cannot decode *ObjectID
- [GODRIVER-591] - ChangeStream option BatchSize is passed to the pipeline stage instead to the cursor
- [GODRIVER-598] - Cannot decode when any ObjectId field is null in database
- [GODRIVER-603] - ChangeStream should not panic when a user changes ResumeToken
- [GODRIVER-611] - UnmarshalExtJSON array fail
- [GODRIVER-630] - EXT JSON Parser Empty Object Handling
- [GODRIVER-644] - SetResumeAfter should take a interface{}
- [GODRIVER-645] - lookupInterfaceDecoder does not ensure type is a pointer
- [GODRIVER-646] - Decoding javascript into bson.D fails
- [GODRIVER-649] - Unmarshaling arrays and objects into bson.D yields bsonx types
- [GODRIVER-650] - MarshalBSON not called for non-primitive types within bson.D
- [GODRIVER-651] - InsertedID from InsertResult is a bsonx
- [GODRIVER-654] - GridFS bindings give int64 but package trys to receive them as int32 from bson
- [GODRIVER-666] - Write concern should not be encoded in aggregate unless $out is specified
New Feature
- [GODRIVER-437] - Add helpers for database and client level change streams
Improvement
- [GODRIVER-211] - Revise connection pooling options on Client/connstring
- [GODRIVER-348] - Refactor Client Creation
- [GODRIVER-469] - Update ChangeStream spec to detail usage of startAtOperationTime
- [GODRIVER-535] - Add support for pointers to reflect.Kind types
- [GODRIVER-542] - Enable dep support
- [GODRIVER-555] - Database.RunCommand should return *DocumentResult
- [GODRIVER-570] - InsertMany docs still claim batching is not supported
- [GODRIVER-571] - CountDocuments documentation references private function countDocumentsAggregatePipeline
- [GODRIVER-595] - Better BSON Transition Errors
- [GODRIVER-614] - Restructure Go Driver Repository
- [GODRIVER-647] - bson.NewDocument should be removed from documentation
- [GODRIVER-653] - Docstring on Raw.Lookup is incorrect for return type
- [GODRIVER-657] - EmptyInterfaceEncoder should handle nil properly
- [GODRIVER-661] - Consolidate objectid and decimal packages into primitive
- [GODRIVER-662] - Change ValueEncoder and ValueDecoder to use reflect.Value instead of interface{}
- [GODRIVER-670] - Move D family of types from bson package to primitive package
- [GODRIVER-673] - ValueReader should support reading the bytes of a top level document
MongoDB Go Driver Alpha 18
The MongoDB Go driver team is pleased to release the eighteenth alpha of the official Go driver.
This alpha release contains major updates to the mongo package and BSON library. Additionally, there are small API updates and bug fixes. This is alpha software, so it is not recommended for production use.
Following semver, the v0 version of the public API should not be considered stable and could change.
Documentation can be found on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.
BSON Library Changes
The Document
, Element
, Value
, and Array
types have been redesign and rewritten. They have been moved from the bson
package to the x/bsonx
package and renamed Doc
, Elem
, Val
, and Arr
respectively. These types are still under development and are likely to change.
The BSON primitive types have been moved from the bson
package to a new package called primitive
. For example the bson.Regex
type is now the primitive.Regex
type.
Mongo API Changes
Options for the mongo
package have been redesigned. Instead of individual packages for groups of option types, there is a single options
package that contains all options. Please refer to the GoDoc page for more details.
Release Notes
Bug
- [GODRIVER-468] - adding _id to a *bson.Document mutates the document.
- [GODRIVER-505] - Client Options should be last one wins
- [GODRIVER-561] - Database.RunCommand should use the provided read preference for server selection
- [GODRIVER-563] - The writeSelector property in the mongo.Database struct should include the LatencySelector
- [GODRIVER-575] - Database.ListCollections should return mongo.Cursor, not command.Cursor
- [GODRIVER-578] - Panic in cursor Close deadlocks
- [GODRIVER-599] - ValueEncoders should check if pointer is nil
New Feature
- [GODRIVER-413] - Implement Improved BSON Design
- [GODRIVER-586] - Implement Improved Go Driver CRUD API
Improvement
- [GODRIVER-151] - Change handling of network errors or timeouts during connection handshake
- [GODRIVER-349] - Separate cursor options from other options in commands
- [GODRIVER-378] - Unconnected Client should return a mongo level error, not topology level error
- [GODRIVER-429] - Move readconcern, readpref, and writeconcern packages to mongo package
- [GODRIVER-541] - Ensure all files have proper licenses
- [GODRIVER-576] - ListCollections filter should be interface{}
- [GODRIVER-610] - Scope & Design Improved BSON Support