how to find a sum using linq in a bson document using C# -
the sample collections structure :-
{ arr : [ { "seq" : 2 }, { "seq" : 4 } ] }
the c# code tried is
var maxticketseq = bsontrans["arr"].asbsonarray.sum(m => (int)m["seq"]);
this working fine...
but structure
{ "arr" : [ { "name" : [{"seq" : 2 } , {"seq" : 5 }] }, { "name" : [{"seq" : 2 } , {"seq" : 5 }] } }
for need find sum of seq.
how achieve in linq query.
actually bsondocument similar 1 getting result of mongo query.
Comments
Post a Comment