function
Open
Open a verified-TLS MongoDB replica-set database with bounded defaults.
Source adapters/mongodb/mongodb.go:91
The URL must select one database. Open checks for a writable replica-set primary with logical sessions but does not create collections, indexes, or migration state.
Example
backend, err := mongodb.Open(ctx, os.Getenv("DATABASE_URL"))
if err != nil {
return err
}
defer backend.Close()Related types
StoreA replica-set implementation of Ridu’s document, snapshot, auth, preference, task, lock, upload, readiness, and migration contracts.