Monthly Archives: May 2014

MongoDB – Some Useful Admin Commands

All the below can be executed from the mongo shell client.

Find queries running for more than few seconds:

Reduce the amount of output in db.currentOp():
db.currentOp() prints a lot of details. To restrict the amount of output, use the following approach. For example, to print only seconds running, client and db/collection info:

Find queries from a specific client IP:

Kill queries from a specific client:

Find queries waiting for lock: