From 58e650d10895e7708cb537adc7167c644465395b Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 19 Oct 2023 10:19:16 -0500 Subject: [PATCH] [master] Updated README.md for highlighting Go syntax (#1426) (#1432) Co-authored-by: Lokesh Kumar --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c446d487b..3a9e738ae3 100644 --- a/README.md +++ b/README.md @@ -161,12 +161,12 @@ The Go Driver supports the following compression algorithms: Compression can be enabled using the `compressors` parameter on the connection string or by using [`ClientOptions.SetCompressors`](https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo/options#ClientOptions.SetCompressors): -``` +```go opts := options.Client().ApplyURI("mongodb://localhost:27017/?compressors=snappy,zlib,zstd") client, _ := mongo.Connect(context.TODO(), opts) ``` -``` +```go opts := options.Client().SetCompressors([]string{"snappy", "zlib", "zstd"}) client, _ := mongo.Connect(context.TODO(), opts) ```