Type alias CommandEventMap

CommandEventMap: {
    commandFailed: ((event) => void);
    commandStarted: ((event) => void);
    commandSucceeded: ((event) => void);
    commandWarnings: ((event) => void);
}

The events emitted by the DataAPIClient. These events are emitted at various stages of the command's lifecycle. Intended for use for monitoring and logging purposes.

Note that these emit real commands, not any abstracted commands like "insertMany" or "updateMany", which may be split into multiple of those commands under the hood.

Type declaration

  • commandFailed: ((event) => void)

    Emitted when a command has errored.

  • commandStarted: ((event) => void)

    Emitted when a command is started, before the initial HTTP request is made.

  • commandSucceeded: ((event) => void)

    Emitted when a command has succeeded.

  • commandWarnings: ((event) => void)

    Emitted when a command has warnings.