Registry / database / mongo-driver

mongo-driver

JSON →
librarygogounverified

Package mongo provides a MongoDB driver for Go.

go get go.mongodb.org/mongo-driver
INSTALL
IMPORT
SIG · MONGO-DRIVER
M
mongo-driver
databasego
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mongo
go.mongodb.org/mongo-driver/mongo

Connect to a MongoDB instance

package main import ( "context" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "log" ) func main() { client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI("mongodb://localhost:27017")) if err != nil { log.Fatal(err) } defer client.Disconnect(context.TODO()) }
Debug
Known issues
breakingBreaking changes between driver versions (e.g., v1 to v2)
fix
Check the version compatibility and update import paths accordingly
affects: >=2.0.0
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
mongo-driver — go get mongo-driver · libregistry