.mean()
Syntax
.mean()
- Returns the mean average numeric value in the Sequence or List.
.mean{expression}
- Returns the mean average, after evaluating the Carrot expression on each element of the Sequence or List.
Examples
- [1, 2, 3, 4].mean() returns 2.5
- [1, 2, 3, 4].mean{it * 3} returns 7.5
- db.job.find{dept:engineering}.mean{baseComp} returns the mean average base compensation in the Engineering department.
