File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ import (
9
9
"go.mongodb.org/mongo-driver/mongo/options"
10
10
)
11
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"
12
+ // Replace the uri string with your MongoDB deployment's connection string.
13
+ const uri = "mongodb+srv://<username>:<password>@<cluster-address>/test?w=majority"
15
14
15
+ func main () {
16
16
client , err := mongo .Connect (context .TODO (), options .Client ().ApplyURI (uri ))
17
17
18
18
if err != nil {
@@ -36,6 +36,6 @@ func main() {
36
36
panic (err )
37
37
}
38
38
39
- fmt .Printf ("%v documents were updated. \n " , result .ModifiedCount )
39
+ fmt .Printf ("Documents updated: %v \n " , result .ModifiedCount )
40
40
41
41
}
You can’t perform that action at this time.
0 commit comments