Given a sharded cluster with multiple indexes defined I would like to retrieve a metric for the overall usage for every index.
Calling db.getCollection("myData").aggregate( [ { $indexStats: { } } ] )
returns a JSON with the accesses.ops
for a single shard.
Is there any chance to either
a) select the shard to get the metric from
b) get the metric from all shards at once in order to sum up the accesses.ops
for every index.
The official documentation says nothing about https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/#mongodb-pipeline-pipe.-indexStats
Thanks,
Jens