Interface RunCommandOptions

Options for executing some arbitrary command.

See

Db.command

interface RunCommandOptions {
    collection?: string;
    extraLogInfo?: Record<string, unknown>;
    keyspace?: null | string;
    maxTimeMS?: "ERROR: The `maxTimeMS` option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using `timeout`";
    namespace?: "ERROR: The `namespace` terminology has been removed, and replaced with `keyspace` throughout the client";
    table?: string;
    timeout?: number | Pick<Partial<TimeoutDescriptor>, "requestTimeoutMs" | "generalMethodTimeoutMs">;
}

Hierarchy (view full)

Properties

collection?: string

The collection to run the command on.

If not provided, the command will run on the keyspace, or directly on the database if keyspace is null.

Only one of this or RunCommandOptions.table should be provided.

extraLogInfo?: Record<string, unknown>

A small string to add to the log message for this command (only if you're printing to stdout/stderr using LoggingConfig).

keyspace?: null | string

Overrides the keyspace to run the command on.

If undefined/not provided, the command will run on the db's default working keyspace.

This may be set to null to run the command directly on the database.

maxTimeMS?: "ERROR: The `maxTimeMS` option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using `timeout`"

This temporary error-ing property exists for migration convenience, and will be removed in a future version.

Deprecated

  • The maxTimeMS option is no longer available; the timeouts system has been overhauled, and timeouts should now be set using timeout, and defaults in timeoutDefaults. You may generally Ctrl+R replace maxTimeMS with timeout to retain the same behavior.
namespace?: "ERROR: The `namespace` terminology has been removed, and replaced with `keyspace` throughout the client"

This temporary error-ing property exists for migration convenience, and will be removed in a future version.

Deprecated

  • The namespace terminology has been removed, and replaced with keyspace throughout the client.
table?: string

The collection to run the command on.

If not provided, the command will run on the keyspace, or directly on the database if keyspace is null.

Only one of this or RunCommandOptions.table should be provided.

timeout?: number | Pick<Partial<TimeoutDescriptor>, "requestTimeoutMs" | "generalMethodTimeoutMs">

The method timeout override.

See TimeoutDescriptor for much more information.