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 {{ ctx.payload.hits.total }} when using min_doc_count).

Hey,

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

--Alex

That worked; thanks.