Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Completed
Categories MongoDB Shell
Created by Guest
Created on Feb 18, 2021

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.
  • ADMIN RESPONSE
    Oct 18, 2025
    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.