Home
Designing Analytics Reports
MongoDB summing an array
Migrateduser
<p>I have a timeseries documents in a mongodb collection. One of the fields is an array containing 10 values. I want to plot the sum of these 10 values against date.</p>
<p> </p>
<p>Using BIRT under Eclipse (4.6.0) I created a computed column as follows:</p>
<p> </p>
<p>row["return"].reduce(function(a, b) {return a + b;}, 0)</p>
<p> </p>
<p>validation of this calculation works but when I include the computed value in a chart a BIRT exception is generated saying that the reduce method cant be found.</p>
<p> </p>
<p>Does anyone have any ideas about what I'm doing wrong or how I could achieve what I want using another approach?</p>
Find more posts tagged with
Comments
There are no comments yet