Skip to content

Commit

Permalink
force zstd first
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed May 30, 2024
1 parent 1a77194 commit 72ee938
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func connect_to_mongodb() {
fmt.Println("Connecting to MongoDB...")
fmt.Println("MONGODB_URI: len=", len(MONGODB_URI))
serverAPI := options.ServerAPI(options.ServerAPIVersion1)
opts := options.Client().ApplyURI(MONGODB_URI).SetServerAPIOptions(serverAPI).SetAppName("solar-tracker")
opts := options.Client().ApplyURI(MONGODB_URI).SetServerAPIOptions(serverAPI).SetAppName("solar-tracker").SetCompressors([]string{"zstd", "zlib", "snappy"})
fmt.Println("AppName: ", *opts.AppName)
fmt.Println("Compressors: ", opts.Compressors)

client, err := mongo.Connect(context.TODO(), opts)
Expand Down

0 comments on commit 72ee938

Please sign in to comment.