How do I abort a query in mongo JavaScript shell

后端 未结 1 1781
既然无缘
既然无缘 2021-01-01 16:07

Executing queries in the JavaScript shell of Mongo feels a lot like executing commands right in the bash shell. Because of this, my fingers keep trying to Ctrl+

1条回答
  •  有刺的猬
    2021-01-01 16:10

    What I've always naturally done is type a ( and then immediately hit enter three times. The shell will assume you are just hitting enter to break up your command, but if you hit enter 2 more times it will exit back to the shell. It's wonky, but it works.


    Edit: Use ctrl+d, which "kills the shell" according to http://www.gotothings.com/unix/bash-hotkeys.htm. If you hit this once after hitting enter in the middle of typing a command in the mongo shell, it will exit your continuation and get you back to a clean mongo prompt. Hitting it twice will exit the mongo shell.

    0 讨论(0)
提交回复
热议问题