const mixinafMongo::ConnectionManager

afMongo::ConnectionManager

Manages connections to a MongoDB instance.

@see ConnectionManagerPooled

leaseConnection

Source

abstract Obj? leaseConnection(|Connection->Obj? c)

Makes a connection available to the given function.

What ever is returned from the func is returned from the method.

mongoUrl

Source

abstract Uri? mongoUrl()

Basic details of where this ConnectionManager connects 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.

shutdown

Source

abstract ConnectionManager shutdown()

Closes all MongoDB connections.

startup

Source

abstract ConnectionManager startup()

Does what ever the ConnectionManager needs 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.

writeConcern

Source

abstract Str:Obj? writeConcern()

The default write concern that all write operations use if none supplied.

Defaults to ["w": 1, "wtimeout": 0, "j": false]

  • write operations are acknowledged,
  • write operations never time out,
  • write operations need not be committed to the journal.