Control-C to cancel current execution only - without exiting from mongo shell
when you started some complex query and realized that it could take time - you want to cancel it. if you press Control-C you will be kicked out of mongo shell. so you have to login back and switch to proper database; probably, set all variables again etc.
there should be option to cancel just current execution leaving you in current session.
1
vote
Sergey
shared this idea
This is available in mongosh 0.13.1+. When you do Ctrl-C, the shell will attempt to cleanly kill the operation on the server and get you back to the prompt right away.