Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop all running mongo background operations?

I am getting this error when running tests in node.

MongoError: cannot perform operation: a background operation is currently running for ...

I need a way to stop all running background operations via the command line.

like image 731
ThomasReggi Avatar asked Nov 28 '25 02:11

ThomasReggi


1 Answers

You need db.killOp(). This will kill a list of current operations which you can obtain via db.currentOp() which returns a list of all the current operations.

like image 69
Joe Drumgoole Avatar answered Nov 29 '25 19:11

Joe Drumgoole



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!