From 405ff8c2b5c9c7e47e7212ce147ab73647372436 Mon Sep 17 00:00:00 2001 From: Wan Bachtiar Date: Mon, 28 Feb 2022 19:38:26 +1100 Subject: [PATCH] Updated to use MongoDB driver v1.8.3 --- README.md | 4 ++-- get-started.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0ac294f..db48710 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Repository to help getting started with MongoDB Go driver connecting to MongoDB ## Information -This Get-Started project uses [MongoDB Go driver](https://godoc.org/go.mongodb.org/mongo-driver/mongo) version 1.6.0 by default. Although you can change the driver version, the provided code example was only tested against the default version of MongoDB driver. There is no guarantee that the code sample will work for all possible versions of the driver. +This Get-Started project uses [MongoDB Go driver](https://godoc.org/go.mongodb.org/mongo-driver/mongo) version 1.8.3 by default. Although you can change the driver version, the provided code example was only tested against the default version of MongoDB driver. There is no guarantee that the code sample will work for all possible versions of the driver. ## Pre-requisites @@ -26,7 +26,7 @@ Execute the helper shell script followed by the MongoDB URI that you would like To use a different driver version, specify the driver version after the MongoDB URI. For example: ``` -./get-started.sh "mongodb+srv://usr:pwd@example.mongodb.net/dbname?retryWrites=true" 1.5.0 +./get-started.sh "mongodb+srv://usr:pwd@example.mongodb.net/dbname?retryWrites=true" 1.6.0 ``` ### Execute commands within the Docker environment diff --git a/get-started.sh b/get-started.sh index 195260e..5c7cbf2 100755 --- a/get-started.sh +++ b/get-started.sh @@ -5,10 +5,11 @@ then read -p "MONGODB URI (Required): " MONGODB_URI fi -DRIVER_VERSION=${2:-1.6.0} +DRIVER_VERSION=${2:-1.8.3} echo "Executing ... " docker run --rm -e MONGODB_URI=${MONGODB_URI} \ -v "$(pwd)":/workspace \ -w /workspace/go ghcr.io/mongodb-developer/get-started-go \ "sed -i 's/mongo-driver v[x0-9]\+\.[x0-9]\+\.[x0-9]\+/mongo-driver v${DRIVER_VERSION}/g' /workspace/go/go.mod; \ + go mod download all; \ go run getstarted.go"