I am trying to count in my mongodb profiler data all the documents, that have been moved when they were updated.
In the mongo shell I do this via:
db.system.profile.find({op:"update", moved:true}).count()
which works fine. But now I want to incorporate this into a python script where I am using pymongo.
My attempt looks like this:
db.system.profile.find({'op':"update"},{'moved':"true"}).count()
but I get the error message: name 'moved' is not defined.
I read the pymongo docu and did quite a bit of research and tried to understand how pymongo is treating the find command as in Using .sort with PyMongo or here: http://blog.pythonisito.com/2012/01/moving-along-with-pymongo.html
but I don't find a solution. Any help would be greatly appreciated. Thanks!