Structures
The following structures are available globally.
-
An event published when a command starts.
See moreDeclaration
Swift
public struct CommandStartedEvent : MongoSwiftEvent, CommandEventProtocol
-
An event published when a command succeeds.
See moreDeclaration
Swift
public struct CommandSucceededEvent : MongoSwiftEvent, CommandEventProtocol
-
An event published when a command fails.
See moreDeclaration
Swift
public struct CommandFailedEvent : MongoSwiftEvent, CommandEventProtocol
-
Published when a server description changes. This does NOT include changes to the server’s roundTripTime property.
See moreDeclaration
Swift
public struct ServerDescriptionChangedEvent : MongoSwiftEvent
-
Published when a server is initialized.
See moreDeclaration
Swift
public struct ServerOpeningEvent : MongoSwiftEvent
-
Published when a server is closed.
See moreDeclaration
Swift
public struct ServerClosedEvent : MongoSwiftEvent
-
Published when a topology description changes.
See moreDeclaration
Swift
public struct TopologyDescriptionChangedEvent : MongoSwiftEvent
-
Published when a topology is initialized.
See moreDeclaration
Swift
public struct TopologyOpeningEvent : MongoSwiftEvent
-
Published when a topology is closed.
See moreDeclaration
Swift
public struct TopologyClosedEvent : MongoSwiftEvent
-
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 moreDeclaration
Swift
public struct ServerHeartbeatStartedEvent : MongoSwiftEvent
-
Published when the server monitor’s ismaster succeeds.
See moreDeclaration
Swift
public struct ServerHeartbeatSucceededEvent : MongoSwiftEvent
-
Published when the server monitor’s ismaster fails, either with an “ok: 0” or a socket exception.
See moreDeclaration
Swift
public struct ServerHeartbeatFailedEvent : MongoSwiftEvent
-
A struct to represent the BSON Binary type.
See moreDeclaration
Swift
public struct Binary : BSONValue, Equatable, Codable, Hashable
-
A struct to represent the deprecated DBPointer type. DBPointers cannot be instantiated, but they can be read from existing documents that contain them.
See moreDeclaration
Swift
public struct DBPointer : BSONValue, Codable, Equatable, Hashable
-
A struct to represent the BSON Decimal128 type.
See moreDeclaration
Swift
public struct Decimal128 : BSONValue, Equatable, Codable, CustomStringConvertible
extension Decimal128: Hashable
-
A struct to represent BSON CodeWithScope.
See moreDeclaration
Swift
public struct CodeWithScope : BSONValue, Equatable, Codable, Hashable
-
A struct to represent the BSON Code type.
See moreDeclaration
Swift
public struct Code : BSONValue, Equatable, Codable, Hashable
-
A struct to represent the BSON ObjectId type.
See moreDeclaration
Swift
public struct ObjectId : BSONValue, Equatable, CustomStringConvertible, Codable
extension ObjectId: Hashable
-
A struct to represent a BSON regular expression.
See moreDeclaration
Swift
public struct RegularExpression : BSONValue, Equatable, Codable, Hashable
-
A struct to represent the deprecated Symbol type. Symbols cannot be instantiated, but they can be read from existing documents that contain them.
See moreDeclaration
Swift
public struct Symbol : BSONValue, CustomStringConvertible, Codable, Equatable, Hashable
-
A struct to represent the BSON Timestamp type.
See moreDeclaration
Swift
public struct Timestamp : BSONValue, Equatable, Codable, Hashable
-
Options struct used for configuring the coding strategies on
See moreBSONEncoder
andBSONDecoder
.Declaration
Swift
public struct BSONCoderOptions : CodingStrategyProvider
-
A struct representing the BSON document type.
See moreDeclaration
Swift
@dynamicMemberLookup public struct Document
extension Document: Codable
extension Document: Collection
extension Document: Sequence
extension Document: Equatable
extension Document: CustomStringConvertible
extension Document: ExpressibleByDictionaryLiteral
extension Document: Hashable
-
A token used for manually resuming a change stream. Pass this to the
See moreresumeAfter
field ofChangeStreamOptions
to resume or start a change stream where a previous one left off.Declaration
Swift
public struct ResumeToken : Codable, Equatable
-
An
See moreUpdateDescription
containing fields that will be present in the change stream document for operations of typeupdate
.Declaration
Swift
public struct UpdateDescription : Codable
-
The response document type from a
See moreChangeStream
.Declaration
Swift
public struct ChangeStreamEvent<T> : Codable where T : Decodable, T : Encodable
-
Options to use when creating a
See moreChangeStream
.Declaration
Swift
public struct ChangeStreamOptions : Codable
-
Options to use when creating a
See moreMongoClient
.Declaration
Swift
public struct ClientOptions : CodingStrategyProvider, Decodable
-
Options to use when retrieving a
See moreMongoDatabase
from aMongoClient
.Declaration
Swift
public struct DatabaseOptions : CodingStrategyProvider
-
Options used to configure TLS/SSL connections to the database.
See moreDeclaration
Swift
public struct TLSOptions
-
A MongoDB collection.
See moreDeclaration
Swift
public struct MongoCollection<T> where T : Decodable, T : Encodable
-
Options to use with a
See moreWriteModel.deleteOne
orWriteModel.deleteMany
.Declaration
Swift
public struct DeleteModelOptions : Codable
-
Options to use with a
See moreWriteModel.replaceOne
.Declaration
Swift
public struct ReplaceOneModelOptions : Codable
-
Options to use with a
See moreWriteModel.updateOne
orWriteModel.updateMany
.Declaration
Swift
public struct UpdateModelOptions : Codable
-
Options to use when performing a bulk write operation on a
See moreMongoCollection
.Declaration
Swift
public struct BulkWriteOptions : Codable
-
The result of a bulk write operation on a
See moreMongoCollection
.Declaration
Swift
public struct BulkWriteResult : Decodable
-
Options to use when executing a
See morefindOneAndDelete
command on aMongoCollection
.Declaration
Swift
public struct FindOneAndDeleteOptions : FindAndModifyOptionsConvertible, Decodable
-
Options to use when executing a
See morefindOneAndReplace
command on aMongoCollection
.Declaration
Swift
public struct FindOneAndReplaceOptions : FindAndModifyOptionsConvertible, Decodable
-
Options to use when executing a
See morefindOneAndUpdate
command on aMongoCollection
.Declaration
Swift
public struct FindOneAndUpdateOptions : FindAndModifyOptionsConvertible, Decodable
-
A struct representing an index on a
See moreMongoCollection
.Declaration
Swift
public struct IndexModel : Codable
-
Options to use when creating an index for a collection.
See moreDeclaration
Swift
public struct IndexOptions : Codable
-
Options to use when executing an
See moreinsertOne
command on aMongoCollection
.Declaration
Swift
public struct InsertOneOptions : Codable, BulkWriteOptionsConvertible
-
Options to use when executing an
See moreupdate
command on aMongoCollection
.Declaration
Swift
public struct UpdateOptions : Codable, BulkWriteOptionsConvertible
-
Options to use when executing a
See morereplace
command on aMongoCollection
.Declaration
Swift
public struct ReplaceOptions : Codable, BulkWriteOptionsConvertible
-
Options to use when executing a
See moredelete
command on aMongoCollection
.Declaration
Swift
public struct DeleteOptions : Codable, BulkWriteOptionsConvertible
-
The result of an
See moreinsertOne
command on aMongoCollection
.Declaration
Swift
public struct InsertOneResult : Decodable
-
The result of a multi-document insert operation on a
See moreMongoCollection
.Declaration
Swift
public struct InsertManyResult
-
The result of a
See moredelete
command on aMongoCollection
.Declaration
Swift
public struct DeleteResult : Decodable
-
The result of an
See moreupdate
operation on aMongoCollection
.Declaration
Swift
public struct UpdateResult : Decodable
-
Options to use when dropping a collection.
See moreDeclaration
Swift
public struct DropCollectionOptions : Codable
-
Options to set on a retrieved
See moreMongoCollection
.Declaration
Swift
public struct CollectionOptions : CodingStrategyProvider
-
Options to use when executing a
See moredropDatabase
command.Declaration
Swift
public struct DropDatabaseOptions : Codable
-
A MongoDB Database.
See moreDeclaration
Swift
public struct MongoDatabase
-
Thrown when commands experience errors on the server that prevent execution.
See moreDeclaration
Swift
public struct CommandError : ServerError
-
An error that is thrown when a single write command fails on the server.
See moreDeclaration
Swift
public struct WriteError : ServerError
-
A error that ocurred while executing a bulk write.
See moreDeclaration
Swift
public struct BulkWriteError : ServerError
-
An error thrown when the driver encounters a internal error not caused by the user. This is usually indicative of a bug in the driver or system related failure (e.g. memory allocation failure).
See moreDeclaration
Swift
public struct InternalError : RuntimeError
-
An error thrown when encountering a connection or socket related error. May contain labels providing additional information on the nature of the error.
See moreDeclaration
Swift
public struct ConnectionError : RuntimeError, LabeledError
-
An error thrown when encountering an authentication related error (e.g. invalid credentials).
See moreDeclaration
Swift
public struct AuthenticationError : RuntimeError
-
An error thrown when trying to use a feature that the deployment does not support.
See moreDeclaration
Swift
public struct CompatibilityError : RuntimeError
-
An error that occured when trying to select a server (e.g. a timeout, or no server matched read preference).
See moreDeclaration
Swift
public struct ServerSelectionError : RuntimeError
-
A struct to represent a single write error not resulting from an executed write operation.
See moreDeclaration
Swift
public struct WriteFailure : Codable
-
A struct to represent a write concern error resulting from an executed write operation.
See moreDeclaration
Swift
public struct WriteConcernFailure : Codable
-
A struct to represent a write error resulting from an executed bulk write.
See moreDeclaration
Swift
public struct BulkWriteFailure : Codable
-
Represents a MongoDB namespace for a database or collection.
See moreDeclaration
Swift
public struct MongoNamespace : Codable, Equatable
extension MongoNamespace: CustomStringConvertible
-
Options to use when executing an
See moreaggregate
command on aMongoCollection
.Declaration
Swift
public struct AggregateOptions : Codable
-
Options to use when executing a
See morecountDocuments
command on aMongoCollection
.Declaration
Swift
public struct CountDocumentsOptions : Codable
-
Options to use when executing a
See morecreateCollection
command on aMongoDatabase
.Declaration
Swift
public struct CreateCollectionOptions : Codable, CodingStrategyProvider
-
Options to use when creating a new index on a
See moreMongoCollection
.Declaration
Swift
public struct CreateIndexOptions : Encodable
-
Options to use when executing a
See moredistinct
command on aMongoCollection
.Declaration
Swift
public struct DistinctOptions : Codable
-
Options to use when dropping an index from a
See moreMongoCollection
.Declaration
Swift
public struct DropIndexOptions : Encodable
-
Options to use when executing an
See moreestimatedDocumentCount
command on aMongoCollection
.Declaration
Swift
public struct EstimatedDocumentCountOptions : Codable
-
Options to use when executing a
See morefind
command on aMongoCollection
.Declaration
Swift
public struct FindOptions : Codable
-
Options to use when executing a
See morefindOne
command on aMongoCollection
.Declaration
Swift
public struct FindOneOptions : Codable
-
Info about the collection that is returned with a
See morelistCollections
call.Declaration
Swift
public struct CollectionSpecificationInfo : Codable
-
Specifications of a collection returned when executing
See morelistCollections
.Declaration
Swift
public struct CollectionSpecification : Codable
-
Options to use when executing a
See morelistCollections
command on aMongoDatabase
.Declaration
Swift
public struct ListCollectionsOptions : Encodable
-
A struct modeling the information returned from the
See morelistDatabases
command about a single database.Declaration
Swift
public struct DatabaseSpecification : Codable
-
Options to use when running a command against a
See moreMongoDatabase
.Declaration
Swift
public struct RunCommandOptions : Encodable
-
Options to use when creating a
See moreClientSession
.Declaration
Swift
public struct ClientSessionOptions
-
A struct to represent a MongoDB read concern.
See moreDeclaration
Swift
public struct ReadConcern : Codable
extension ReadConcern: CustomStringConvertible
extension ReadConcern: Equatable
-
A struct representing a network address, consisting of a host and port.
See moreDeclaration
Swift
public struct Address : Equatable
-
A struct describing a mongod or mongos process.
See moreDeclaration
Swift
public struct ServerDescription
extension ServerDescription: 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.
See moreDeclaration
Swift
public struct TopologyDescription : Equatable
-
A class to represent a MongoDB write concern.
See moreDeclaration
Swift
public struct WriteConcern : Codable
extension WriteConcern: CustomStringConvertible
extension WriteConcern: Equatable