executeOpQuery(_:in:sessionId:logMetadata:traceLabel:serviceContext:)

    Executes a command on the server and returns the reply, or throws an error if the command failed. This method is used for executing commands that are not encoded as BSON documents. Always uses OP_QUERY.

    Connection+Execute.swift:125
    func executeOpQuery(_ query: inout OpQuery, in transaction: MongoTransaction? = nil, sessionId: SessionIdentifier? = nil, logMetadata: Logger.Metadata? = nil, traceLabel: String = "executeCommand", serviceContext context: ServiceContext? = nil) async throws -> OpReply

    Parameters

    command

    The command to execute on the server. Updated with the next request id.

    namespace

    The namespace to execute the command in. Defaults to the administrative command namespace.

    transaction

    The transaction to execute the command in.

    Other members in extension

    Type members

    Instance members