使用c# Mongo Driver 完成嵌套查询

someObj :


...
{
IList<Segment> Segments;
}
...


Segment {
RootNetwork
...
Stack<Network> NetworksStack;
...
}


Network {
...
string CourierId
...
}



查询出所有与传入 CourierId匹配的结果


var qrySegNetworkStack = Query<MDDelivery>.ElemMatch(d => d.Segments, seg => seg.ElemMatch(s => s.NetworksStack, nw => nw.Where(n => n.CourierId == userInfo.UserNetworkId)));

你可能感兴趣的:(使用c# Mongo Driver 完成嵌套查询)