agg = [
{
"$match": {
"create_time": {
"$gt": datetime.datetime(now.year, 1, 1).strftime("%Y-%m-%d %H:%M:%S"),
"$lte": now.strftime("%Y-%m-%d %H:%M:%S")
}
}
},
{
"$group": {
"_id": "$fieldA",
"a_count": {"$sum": "$statistics.call.a"},
"b_count": {"$sum": "$statistics.call.b"},
"ct_count": {"$sum": "$statistics.call.c"},
}
}
]
网友评论