The MongoDB Go driver team is pleased to release version 1.9.0 of the official Go driver.
Release Notes
This release contains improvements to connection pool management, an extended API, and a number of bug fixes.
Connection storm mitigation
Previously, the propensity of the driver to inundate a server with new connections during failover events was a particular pain point. This version of the driver contains a number of improvements to mitigate these connection "storms" including:
Consider server load during server selection
Prevent creating connections to unhealthy servers
Re-select a server if that server becomes unhealthy during check-out
Custom Aggregate and ChangeStream options
Certain use-cases may require supplying custom options on aggregate commands. These aggregate operations could be on a Database, Collection or for the creation of a ChangeStream. This version of the driver adds new API to specify custom options in these cases:
ChangeStreamOptions.Custom specifies custom options to be added to the change stream creation aggregate expression
ChangeStreamOptions.CustomPipeline specifies custom options to be added to the $changeStream pipeline stage in the change stream creation aggregate expression
Note that all the custom options above must be marshalable into BSON. Users should always prefer using non-custom options where possible.
Let option for CRUD commands
This version of the driver adds a Let option to most CRUD command options. Let can be used to specify parameters for use in an aggregate expression context (e.g. "$$var"). Let must be a document mapping parameter names to values that are constant or closed expressions without references to document fields. Note that the Let option can only be used against server version 5.0 or higher. Let has been added to:
AggregateOptions
BulkWriteOptions
DeleteOptions
FindOptions
FindOneAndDeleteOptions
FindOneAndReplaceOptions
FindOneAndUpdateOptions
ReplaceOptions
UpdateOptions
Cursor and SingleResult constructors
This version of the driver exposes API to create Cursor and SingleResult instances from BSON document(s). In particular, two new constructor functions have been added: NewCursorFromDocuments and NewSingleResultFromDocument. The supplied document(s) must be marshalable and non-nil. These new functions should allow for the mocking of read operation results (such as Find, FindOne and Aggregate) for use in testing.
For a full list of tickets included in this release, please see the links below:
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps go.mongodb.org/mongo-driver from 1.4.0 to 1.9.0.
Release notes
Sourced from go.mongodb.org/mongo-driver's releases.
... (truncated)
Commits
35f33da
Update version to v1.9.0d4636c2
GODRIVER-2370 fix error message in CSFLE Custom Endpoint test Case 5897aa8f
fix typo in comment (#897)b8d17a9
GODRIVER-2360 replace admin db in CSFLE examples (#894)3d60e91
GODRIVER-2068 Use monitor.TestPoolMonitor to replace most connection pool mon...5970415
GODRIVER-2311 Improve the BSON unmarshal buffer reuse fix to reduce memory al...023a864
GODRIVER-2310 Add snapshot query examples (#887)0cd9fa6
GODRIVER-2349 Seed all pseudorandom number generators with a crypto-secure ra...a26cf64
Remove unused ServerOption error. (#888)a6626e6
GODRIVER-2351 Add missing nil option checks (#883)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)