My query is working fine on the mongo shell. But when running through pymongo is giving error. Can someone help me with this one.
db.collectioname.aggregate([
{ "$match": { "$and": [
{ "organization_id": int(organization_id) },
{ "resulttime":{
"$gte":stdate,
"$lte":enddate
}
}
]
}
},
{ "$skip" : int(offset) },
{ "$limit" : int(limit) },
{ "$group": {
"_id": "$userid",
"max_temperature": { "$max": "$temperature" },
"min_temperature": { "$min": "$temperature" }
}}
])
However, I am getting an error as
pymongo.errors.OperationFailure: unknown operator: $max