Manages connections to a MongoDB instance.
abstract Str? authSource()
The name of the database users are authenticated against. If null, users are authenticated against the current database.
Makes a connection available to the given function.
What ever is returned from the func is returned from the method.
abstract Uri? mongoUrl()
Basic details of where this
ConnectionManagerconnects to, for debugging purposes. When connecting to replica sets, this should indicate the primary.
It should not contain any user credentials and should be safe to log.
abstract ConnectionManager shutdown()
Closes all MongoDB connections.
abstract ConnectionManager startup()
Does what ever the
ConnectionManagerneeds to do to initialise itself.
Often this would be create database connections or other network related activity that it may not wish to do inside a ctor.
The default write concern that all write operations use if none supplied.
["w": 1, "wtimeout": 0, "j": false]
- write operations are acknowledged,
- write operations never time out,
- write operations need not be committed to the journal.