TopologyDescription
public struct TopologyDescription : Equatable
A struct describing the state of a MongoDB deployment: its type (standalone, replica set, or sharded), which servers are up, what type of servers they are, which is primary, and so on.
-
The possible types for a topology.
See moreDeclaration
Swift
public struct TopologyType : RawRepresentable, Equatable, CustomStringConvertible, Decodable
-
The type of this topology.
Declaration
Swift
public let type: TopologyType
-
The replica set name.
Declaration
Swift
public var setName: String? { get }
-
The servers comprising this topology.
Declaration
Swift
public let servers: [ServerDescription]
-
The logicalSessionTimeoutMinutes value for this topology. This value is the minimum of the
logicalSessionTimeoutMinutes
values across all the servers inservers
, ornil
if any of them arenil
.Declaration
Swift
public var logicalSessionTimeoutMinutes: Int? { get }
-
Returns
true
if the topology has a readable server available, andfalse
otherwise.Declaration
Swift
public func hasReadableServer() -> Bool
-
Returns
true
if the topology has a writable server available, andfalse
otherwise.Declaration
Swift
public func hasWritableServer() -> Bool