Skip to content

Commit bf38169

Browse files
committed
Update golang mongo sample to work with GCP mongo support
1 parent a8d3d4b commit bf38169

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

samples/golang-mongodb/app/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func main() {
3737
}
3838
fmt.Println("Connected to MongoDB!")
3939

40-
collection := client.Database("taskManager").Collection("tasks")
40+
collection := client.Database("taskmanager").Collection("tasks")
4141

4242
fs := http.FileServer(http.Dir("./static"))
4343
http.Handle("/", fs)

samples/golang-mongodb/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
environment:
1212
# If you want to use MongoDB Atlas, you can set the URI with `defang config set MONGO_URI`.
1313
# This will override any value set in the environment variable:
14-
- MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/
14+
- MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/taskmanager
1515
#deploy:
1616
# resources:
1717
# reservations:

0 commit comments

Comments
 (0)