Fix pymongo query