feat: compressions for DB connections

This commit is contained in:
yzqzss 2024-05-27 04:25:44 +08:00
parent 8c1eaf8de9
commit 7063002ab6

View File

@ -19,7 +19,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)
opts := options.Client().ApplyURI(MONGODB_URI).SetServerAPIOptions(serverAPI).SetAppName("solar-tracker")
fmt.Println("Compressors: ", opts.Compressors)
client, err := mongo.Connect(context.TODO(), opts)
if err != nil {