Ok given a collection of documents like this:
{
"Name": "A",
"Price": 1.50
}
How do I perform a simple aggregation on the prices in the list? I don't want to perform any grouping, just a simple scalar result.
ie. sum, avg etc
I have tried both of the following without success:
Map only:
for doc in docs
select new { sumPrices = Sum(d => d.Price) }
and
Map:
for doc in docs
select new { price = d.Price }
Reduce:
for result in results
select new { sumPrices = Sum(result) }