Closed jterryhao closed 2 years ago
Hi @jterryhao
mgm
is a wrapper around the mongo go driver, so you have it.
You need to something like this:
_, cli, _, err := mgm.DefaultConfigs()
if err != nil {
panic(err)
}
err=cli.Ping(context.Background(), nil)
Feel free to reopen the issue if needed, please.
Is your feature request related to a problem? Please describe. The first request to mongo is slow due to lazy connection. I'd like to use
client.Ping()
to remove this initial delay. Plus client.Ping() can help to detect mongoDB healthiness. Describe the solution you'd like Some way for library users to callclient.Ping()
Describe alternatives you've considered
Additional context Here I did two rounds of CRUD. First create took ~500ms while second only took ~35ms