Categories
Go MongoDB

Connect your Go applications to MongoDB

Installing the MongoDB Go Driver

Resources

https://docs.mongodb.com/drivers/go/current/

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/

https://www.digitalocean.com/community/tutorials/how-to-use-go-with-mongodb-using-the-mongodb-go-driver

Categories
MongoDB My Go Tutorial

MongoDb Go drivers

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

To get started with the driver, import the mongo package, create a mongo.Client:

import (
    "go.mongodb.org/mongo-driver/mongo"
    "go.mongodb.org/mongo-driver/mongo/options"
)
client, err := mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))

https://docs.mongodb.com/drivers/go