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

后端 未结 3 600
挽巷
挽巷 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 00:51

    According to Mongo documentation, you should:

    1. Obtain the current operation ID via db.currentOp()
    2. Kill opp via db.killOp()

    Good example script can be found here.

提交回复
热议问题