Skip to content

Commit 932f40f

Browse files
committed
moved uri declaration
1 parent 86c5f96 commit 932f40f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/code-snippets/find.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
"go.mongodb.org/mongo-driver/mongo/options"
1010
)
1111

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"
12+
// Replace the uri string with your MongoDB deployment's connection string.
13+
const uri = "mongodb+srv://<username>:<password>@<cluster-address>/test?w=majority"
1514

15+
func main() {
1616
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
1717

1818
if err != nil {

0 commit comments

Comments
 (0)