In the Aggregations input documents we get the estimatedCount. This is just an estimate of the number of documents in the collection. In the Documents tab for the badge we use the document count from the collection stats. Both are just estimates of the number of documents in a collection and both can be null which we handle.
estimatedCount is not fast for timeseries collections and it triggers a colscan so we have a maxTimeMS. But for large timeseries collections this will therefore always start a colscan and then time out. So you would end up with null. So we might as well just use the collection stats like for the Documents tab which should spare us that query