Empty buckets in composite aggregation

I use composite aggregation, some buckets are empty , can i break for loop if bucket is empty . My data set is big, I don't want aggregate the empty buckets. I change the question a little bit, can I get only bucket they have values?