Protocolswift-mongodb 0.27.0MongoCommands->Mongo
Command
A type that represents a MongoDB command. All public command types (and command protocols) ultimately inherit from this protocol.
Mongo.Command.swift:9protocol Command<Response> : Sendable
Supertypes
Requirements
Type members
associatedtype Database
The type of database this command can be run against.
associatedtype ExecutionPolicy
associatedtype ReadConcern
associatedtype Response
The server response this command expects to receive.
associatedtype WriteConcern
static var type: CommandType
The official name of this command, in the MongoDB specification. It always begins with a lowercase letter, and usually resembles the name of the command type.
static func decode(reply: BSON.DocumentDecoder<BSON.Key>
) throws -> Response
Instance members
var fields: BSON.Document
The opaque fields of this command. Not all conforming types will encode all of their fields to this property; some may have fields (such as
readConcern
ormaxTimeMS
) that are recognized by the driver and added later during the command execution process.var outline: OutlineVector?
The payload of this command.
var readConcern: Self.ReadConcern?
var readConcernLabel: Mongo.ReadConcern??
var timeout: MaxTime
var writeConcern: Self.WriteConcern?
var writeConcernLabel: Mongo.WriteConcern?
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (12) members.
Protocols
Types
enum CommandType
struct CursorBatch<Element>
struct CursorIdentifier
A cursor handle that is guaranteed to be non-null.
enum MaxTime
enum Once
enum ReadConcern
The amount of ratification data needs to have received before it can be returned by a read command.
enum Retry
struct Tailing
struct WriteConcern
struct WriteConcernError
enum WriteConcernProvenance
Citizens in MongoCommands
Instance members
var outline: Mongo.OutlineVector?
Returns nil.
var timeout: Mongo.MaxTime
Returns
computed
.
Citizens in MongoCommands
where Self.ReadConcern == Mongo.ReadConcern
Instance members
Citizens in MongoCommands
where Self.ReadConcern == Never
Instance members
Citizens in MongoCommands
where Self.Response:BSONDocumentDecodable, Self.Response.CodingKey == BSON.Key
Type members
static func decode(reply: BSON.DocumentDecoder<BSON.Key>
) throws -> Response Delegates to the
Response
type’sBSONDocumentDecodable
conformance.
Citizens in MongoCommands
where Self.Response == ()
Type members
static func decode(reply: BSON.DocumentDecoder<BSON.Key>
) Does nothing, ignoring the supplied decoding container.
Citizens in MongoCommands
where Self.WriteConcern == Mongo.WriteConcern
Instance members
Citizens in MongoCommands
where Self.WriteConcern == Never
Instance members
Available in MongoDriver
Type members
static var autocommits: Bool
Indicates if this command autocommits, meaning it supports retryable writes.
Subtypes
protocol ImplicitSessionCommand<Response>
A type that can encode a MongoDB command that can be run as part of a session, which can be implicitly generated if the command is sent to a deployment at large.
protocol IterableCommand<Element>
protocol TransactableCommand<Response>