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
Showing only changes of commit 47978662ca - Show all commits

View File

@ -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))