NewDocumentDB 1.0 is here. See what's new
MQL reference navigation

killOp

Requests cancellation of a running operation. Run against admin.

const flightOps = db.currentOp({
  active: true,
  ns: "bookings.flights"
}).inprog
if (flightOps.length > 0) {
  db.killOp(flightOps[0].opid)
}
ParameterDescription
killOp(Required) A command marker, conventionally 1.
op(Required) A string specifying the operation identifier reported by currentOp. Numeric identifiers are rejected by the gateway.

Cancellation is subject to server authorization. See wire protocol and common fields.

Source: gateway processor/data_management.rs, process_kill_op, and pg_documentdb/src/commands/kill_op.c.