mongosh admin --eval 'db.killOp(12345)'

Category: Databases & SQL

mongosh admin --eval 'db.killOp(12345)'

Terminate a running operation

Kills the operation with the given opid, rolling back its work. Only terminate operations initiated by clients; killing internal operations can destabilize the server. Confirm the opid with db.currentOp() first.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.