Mode

public enum Mode : String

An enumeration of possible ReadPreference modes.

  • Default mode. All operations read from the current replica set primary.

    Declaration

    Swift

    case primary
  • In most situations, operations read from the primary but if it is unavailable, operations read from secondary members.

    Declaration

    Swift

    case primaryPreferred
  • All operations read from the secondary members of the replica set.

    Declaration

    Swift

    case secondary
  • In most situations, operations read from secondary members but if no secondary members are available, operations read from the primary.

    Declaration

    Swift

    case secondaryPreferred
  • Operations read from member of the replica set with the least network latency, irrespective of the member’s type.

    Declaration

    Swift

    case nearest