function
Open
Open a verified-TLS MongoDB replica-set database with bounded defaults.
Example
backend, err := mongodb.Open(ctx, os.Getenv("DATABASE_URL"))
if err != nil {
return err
}
defer backend.Close()Arguments
| Argument | Type | Description |
|---|---|---|
ctx | context.Context | The ctx value. |
databaseURL | string | The databaseURL value. |
Returns
The declared result.
(*Store, error)How it works
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.
Full signature
Related types
StoreA replica-set implementation of Ridu’s document, snapshot, auth, preference, task, lock, upload, readiness, and migration contracts.