Structures

The following structures are available globally.

  • An event published when a command starts. The event is stored under the key event in the userInfo property of Notifications posted under the name .commandStarted.

    See more

    Declaration

    Swift

    public struct CommandStartedEvent : MongoEvent, InitializableFromOpaquePointer
  • An event published when a command succeeds. The event is stored under the key event in the userInfo property of Notifications posted under the name .commandSucceeded.

    See more

    Declaration

    Swift

    public struct CommandSucceededEvent : MongoEvent, InitializableFromOpaquePointer
  • An event published when a command fails. The event is stored under the key event in the userInfo property of Notifications posted under the name .commandFailed.

    See more

    Declaration

    Swift

    public struct CommandFailedEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when a server description changes. This does NOT include changes to the server’s roundTripTime property.

    See more

    Declaration

    Swift

    public struct ServerDescriptionChangedEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when a server is initialized.

    See more

    Declaration

    Swift

    public struct ServerOpeningEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when a server is closed.

    See more

    Declaration

    Swift

    public struct ServerClosedEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when a topology description changes.

    See more

    Declaration

    Swift

    public struct TopologyDescriptionChangedEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when a topology is initialized.

    See more

    Declaration

    Swift

    public struct TopologyOpeningEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when a topology is closed.

    See more

    Declaration

    Swift

    public struct TopologyClosedEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when the server monitor’s ismaster command is started - immediately before the ismaster command is serialized into raw BSON and written to the socket.

    See more

    Declaration

    Swift

    public struct ServerHeartbeatStartedEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when the server monitor’s ismaster succeeds.

    See more

    Declaration

    Swift

    public struct ServerHeartbeatSucceededEvent : MongoEvent, InitializableFromOpaquePointer
  • Published when the server monitor’s ismaster fails, either with an “ok: 0” or a socket exception.

    See more

    Declaration

    Swift

    public struct ServerHeartbeatFailedEvent : MongoEvent, InitializableFromOpaquePointer
  • A struct wrapping a BSONValue type that allows for encoding/ decoding BSONValues of unknown type.

    See more

    Declaration

    Swift

    public struct AnyBSONValue : Codable, Equatable, Hashable
  • A struct to represent the BSON null type.

    See more

    Declaration

    Swift

    public struct BSONNull : BSONValue, Codable, Equatable
  • A struct to represent the BSON Binary type.

    See more

    Declaration

    Swift

    public struct Binary : BSONValue, Equatable, Codable
  • A struct to represent the deprecated DBPointer type. DBPointers cannot be instantiated, but they can be read from existing documents that contain them.

    See more

    Declaration

    Swift

    public struct DBPointer : BSONValue, Codable, Equatable
  • A struct to represent the BSON Decimal128 type.

    See more

    Declaration

    Swift

    public struct Decimal128 : BSONNumber, Equatable, Codable, CustomStringConvertible
  • A struct to represent the BSON Code and CodeWithScope types.

    See more

    Declaration

    Swift

    public struct CodeWithScope : BSONValue, Equatable, Codable
  • A struct to represent the BSON MaxKey type.

    See more

    Declaration

    Swift

    public struct MaxKey : BSONValue, Equatable, Codable
  • A struct to represent the BSON MinKey type.

    See more

    Declaration

    Swift

    public struct MinKey : BSONValue, Equatable, Codable
  • A struct to represent the BSON ObjectId type.

    See more

    Declaration

    Swift

    public struct ObjectId : BSONValue, Equatable, CustomStringConvertible, Codable
  • A struct to represent a BSON regular expression.

    See more

    Declaration

    Swift

    public struct RegularExpression : BSONValue, Equatable, Codable
  • A struct to represent the deprecated Symbol type. Symbols cannot be instantiated, but they can be read from existing documents that contain them.

    See more

    Declaration

    Swift

    public struct Symbol : BSONValue, CustomStringConvertible, Codable, Equatable
  • A struct to represent the BSON Timestamp type.

    See more

    Declaration

    Swift

    public struct Timestamp : BSONValue, Equatable, Codable
  • A struct to represent the deprecated Undefined type. Undefined instances cannot be created, but they can be read from existing documents that contain them.

    See more

    Declaration

    Swift

    public struct BSONUndefined : BSONValue, Equatable, Codable
  • A struct representing the BSON document type.

    See more

    Declaration

    Swift

    @dynamicMemberLookup
    public struct Document
  • A struct to represent a single write error not resulting from an executed bulk write.

    See more

    Declaration

    Swift

    public struct WriteError : Codable
  • A struct to represent a write concern error resulting from an executed bulk write.

    See more

    Declaration

    Swift

    public struct WriteConcernError : Codable
  • A struct to represent a write error resulting from an executed bulk write.

    See more

    Declaration

    Swift

    public struct BulkWriteError : Codable
  • A struct representing a server connection, consisting of a host and port.

    See more

    Declaration

    Swift

    public struct ConnectionId : Equatable
  • A struct describing a mongod or mongos process.

    See more

    Declaration

    Swift

    public struct ServerDescription
  • 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.

    See more

    Declaration

    Swift

    public struct TopologyDescription