How do I abort a running query in the MongoDB shell?

后端 未结 3 602
挽巷
挽巷 2021-02-05 00:49

I can\'t believe I have to ask this, but how do I stop a query I just ran, which is now running, and will obviously take a very long time to complete in the Mongo shell? C

3条回答
  •  借酒劲吻你
    2021-02-05 01:00

    Based on Alex's answer.

    1. Query current running operations:

      db.currentOp()
      

    1. Kill the operation based on opid

      db.killOp(30318806)
      

提交回复
热议问题