selectServer

fnNullable!MongoHost selectServer(ref const TopologyDescription topology, ReadPreference pref, long localThresholdMS = 15, long maxStalenessSeconds = - 1) @safe

Selects a server from the topology based on the given read preference.

Returns the host to connect to, or Nullable!MongoHost.init if no suitable server is available.