I am trying to get long running queries (sec_running >= 5) from MongoDB using Python.
Though the command works fine from Mongo console, it throws error or not working as expected when executed using PyMongo. Can someone please guide me on this ?.
How can I execute the below code from Python ?.
db.currentOp({“secs_running”: {$gte: 5}})
I am able to execute “currentOp” using PyMongo, however not able filter for the “secs_running”.
The commands gets executed successfully.
However the filter doesn’t work as expected.
The result set has all the queries that are running irrespective of the “secs_running” value.
Basically it’s the output of “currentOp” as it is.
Filter {"$gt": 5} doesn’t really seems to be working here.