From 47978662ca78d6363b669393ef56fbd519d954c2 Mon Sep 17 00:00:00 2001 From: Sinh Date: Mon, 14 Mar 2022 10:31:44 +0700 Subject: [PATCH] add monitor options --- mongodb.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mongodb.go b/mongodb.go index 2de864f..3786445 100644 --- a/mongodb.go +++ b/mongodb.go @@ -56,6 +56,9 @@ func Connect(cfg Config) (*mongo.Database, error) { Password: opts.Password, } } + if cfg.Monitor != nil { + connectOptions.SetMonitor(cfg.Monitor) + } // Connect client, err := mongo.Connect(context.Background(), connectOptions.ApplyURI(cfg.Host))