Example of using a Session with "snapshot" read concern outside of a transaction for a Find operation:
var client *mongo.Client
// Create a new Session with "snapshot" reads enabled, then create a
// SessionContext with the new Session.
sess, err := client.StartSession(options.Session().SetSnapshot(true))
if err != nil {
panic(err)
}
defer sess.EndSession(context.TODO())
sessCtx := mongo.NewSessionContext(context.TODO(), sess)
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.5.1 to 1.7.0.
Release notes
Sourced from go.mongodb.org/mongo-driver's releases.
... (truncated)
Commits
d98d92b
Update version to v1.7.02dac2a2
Allow snapshot reads (#702)21d5588
GODRIVER-2074 add serverless URIs to Atlas connectivity tests (#700)9dde33f
GODRIVER-2061 Test redaction of replies of security sensitive commands (#703)daa6bdf
GODRIVER-1867 Add new Details field on WriteError for server v5.0 (#694)7e6f265
Update version to v1.7.0+prerelease75b6b0b
GODRIVER-1870 Remove insertedCount assertions and improve usage of unsetOrMat...c3b779c
GODRIVER-2051 resync cursor-related tests (#697)d41f348
GODRIVER-1900 add SetBatchSize to driver.BatchCursor (#699)69f9561
GODRIVER-2019 test against 5.0 servers (#687)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)