this is an exmple for golang to make connect to the mongodb
use the mongo db offical library mongo
go mod init github.com/${your github account name}/${github repo name}
go get -u github.com/joho/godotenv
go get -u go.mongodb.org/mongo-driver/mongo
go get -u go.mongodb.org/mongo-driver/bson
clientOptions := options.Client().ApplyURI(connectString)
client, err := mongo.Connect(context.TODO(), clientOptions)
if err != nil {
log.Fatal(err)
}