I run the following in MongoDB shell (version 4.2, as reference):
while(true) { db.c.update({_id:1}, {$inc: {n: 1}}) }
I want to break the while loop, but without ending the MongoDB shell. If I use Ctrl+C
the loop ends, but also the mongo
process (like if I have done exit
).
Looking to mongo shell documentation I found Ctrl+G
as "abort" but it's not working (it seems to do nothing).
Is possible to do what I'm trying? What the purpose of Ctrl+G
?
Thanks!