How to get the total documents count, containing a specific field, using aggregations?

I am not able to find getDocCount() method in ValueCount aggregation response.

    ValueCount agg = response.getAggregations().get("ValueCountAgg");
            long value = agg.getValue();