ThomasReggi
ThomasReggi

Reputation: 59495

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.

Upvotes: 3

Views: 2350

Answers (1)

Joe Drumgoole
Joe Drumgoole

Reputation: 1348

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.

Upvotes: 4

Related Questions