We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86c5f96 commit 932f40fCopy full SHA for 932f40f
source/code-snippets/find.go
@@ -9,10 +9,10 @@ import (
9
"go.mongodb.org/mongo-driver/mongo/options"
10
)
11
12
-func main() {
13
- // Replace the uri string with your MongoDB deployment's connection string.
14
- uri := "mongodb+srv://<username>:<password>@<cluster-address>/test?w=majority"
+// Replace the uri string with your MongoDB deployment's connection string.
+const uri = "mongodb+srv://<username>:<password>@<cluster-address>/test?w=majority"
15
+func main() {
16
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
17
18
if err != nil {
0 commit comments