-2
如何在java中實現這個聚合查詢我不知道該怎麼做?mongodb聚合函數在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"}}
}
}
])
你能證明你已經嘗試過什麼, – radhakrishnan