草庐IT

VolPeopleCount

全部标签

c# - 条件聚合器的 MongoDb.Linq 等效查询

我按以下方式使用MongoDb.Linq对我的数据进行分组:groupr1bynew{r1.SupId,r1.SupFullName}intog2selectnew{g2.Key.SupFullName,Volunteers=fromv0ing2wherev0.VolId!=g2.Key.SupIdselectnew{v0.VolFullName,v0.VolPeopleCount}}也就是说,我只希望在Volunteers中那些Id与组key不同的人。我期待驱动程序生成一个条件$push,但它给出了一个简单的:"$push":{"VolFullName":"$VolFullName"