From 33c88ef31c0477a6f14e00d75f4c086eeb7c3e77 Mon Sep 17 00:00:00 2001 From: Lokesh Kumar Date: Mon, 16 Oct 2023 15:13:03 +0200 Subject: [PATCH] Updated README.md for highlighting Go syntax (#1426) (cherry picked from commit 6c39f4fb4105727d4cdc62ba45668db50119bc42) --- 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) ```