Alternativly, the call to mongoc_client_set_appname (client, "r/mongolite"); could be removed entirely since appname is not intended to be set by a driver.
However, removing the call could cause friction on users that are tracking mongolite clients through the existing r/mongolite appname.
Summary Only call
mongoc_client_set_appname
if theappname
URI option is not set.Motivation
appname
is a URI option users may set themselves: https://docs.mongodb.com/manual/reference/connection-string/#miscellaneous-configurationBefore this change:
Attempting to set the
appname
in the URI results in a warning:The appname set in the URI is applied first. Observing
mongod
logs of the handshake showsapplication.name
isfoo
.After this change:
No warning is reported by mongolite.
Rejected Alternatives
Alternativly, the call to
mongoc_client_set_appname (client, "r/mongolite");
could be removed entirely sinceappname
is not intended to be set by a driver.However, removing the call could cause friction on users that are tracking
mongolite
clients through the existingr/mongolite
appname.