Computing aggregation bucket size in actions

I'm trying to get the number of buckets in my aggregation.

I tried {{ ctx.payload.aggregations.myAgg.buckets.size() }}, but nothing was displayed. I've seen other posts using that method in conditions, but I need it in actions.

I would also like to get the sum of each bucket's doc_count (different than {{ }} when using min_doc_count).


mustache requires you to use {{ ctx.payload.aggregations.myAgg.buckets.size}} as there is no support for calling functions...


That worked; thanks.