add monitor options #6

Merged
luuvansinh merged 1 commits from add-monitor into master 2022-03-14 03:34:05 +00:00
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,9 @@ func Connect(cfg Config) (*mongo.Database, error) {
Password: opts.Password, Password: opts.Password,
} }
} }
if cfg.Monitor != nil {
connectOptions.SetMonitor(cfg.Monitor)
}
// Connect // Connect
client, err := mongo.Connect(context.Background(), connectOptions.ApplyURI(cfg.Host)) client, err := mongo.Connect(context.Background(), connectOptions.ApplyURI(cfg.Host))