.
from doc in docs
where doc["@metadata"]["Raven-Entity-Name"] == "Books"
select new { Name = "Total", Price = doc.Price };
:
from result in results
group result by result.Name
into g
select new { Name = g.Key, Price = g.Sum(x => x.Price) }
, , . , :
{
"Name":"B",
"Price":4
}
{
"Name":"A",
"Price":10
}
JSON :
{"Results":[{"Name":"Total","Price":"14","Price_Range":"14"}],"IsStale":false,"TotalResults":1}
, . RavenDB, , , , Sum() .