ServerDescription

public struct ServerDescription

A struct describing a mongod or mongos process.

  • The possible types for a server.

    See more

    Declaration

    Swift

    public enum ServerType : String
  • The hostname or IP and the port number that the client connects to. Note that this is not the server’s ismaster.me field, in the case that the server reports an address different from the address the client uses.

    Declaration

    Swift

    public let connectionId: ConnectionId
  • The last error related to this server.

    Declaration

    Swift

    public let error: MongoError?
  • The duration of the server’s last ismaster call.

    Declaration

    Swift

    public var roundTripTime: Int64?
  • The lastWriteDate from the server’s most recent ismaster response.

    Declaration

    Swift

    public var lastWriteDate: Date?
  • The last opTime reported by the server. Only mongos and shard servers record this field when monitoring config servers as replica sets.

    Declaration

    Swift

    public var opTime: ObjectId?
  • The type of this server.

    Declaration

    Swift

    public var type: ServerDescription.ServerType
  • The minimum wire protocol version supported by the server.

    Declaration

    Swift

    public var minWireVersion: Int32
  • The maximum wire protocol version supported by the server.

    Declaration

    Swift

    public var maxWireVersion: Int32
  • me

    The hostname or IP and the port number that this server was configured with in the replica set.

    Declaration

    Swift

    public var me: ConnectionId?
  • This server’s opinion of the replica set’s hosts, if any.

    Declaration

    Swift

    public var hosts: [ConnectionId]
  • This server’s opinion of the replica set’s arbiters, if any.

    Declaration

    Swift

    public var arbiters: [ConnectionId]
  • Passives are priority-zero replica set members that cannot become primary. The client treats them precisely the same as other members.

    Declaration

    Swift

    public var passives: [ConnectionId]
  • Tags for this server.

    Declaration

    Swift

    public var tags: [String : String]
  • The replica set name.

    Declaration

    Swift

    public var setName: String?
  • The replica set version.

    Declaration

    Swift

    public var setVersion: Int64?
  • The election ID where this server was elected, if this is a replica set member that believes it is primary.

    Declaration

    Swift

    public var electionId: ObjectId?
  • This server’s opinion of who the primary is.

    Declaration

    Swift

    public var primary: ConnectionId?
  • When this server was last checked.

    Declaration

    Swift

    public let lastUpdateTime: Date?
  • The logicalSessionTimeoutMinutes value for this server.

    Declaration

    Swift

    public var logicalSessionTimeoutMinutes: Int64?