如何在java中实现这个聚合查询我不知道该怎么办?
db.History.aggregate([
{ "$match" : {"thId":"001"}},
{ "$group" : {
"_id" : {"Id":"$Id","controller" : "$controller","mod" : "$mod","variable" : "$variable"}
,"variable" : {"$first": "$$ROOT"}
,"data" : {"$push":{"value":"$value","updatedDateTime":"$updatedTime"}}
}
}
])