Load the practice collection
Run once in mongosh against a development instance with an empty usageOrders practice collection.
const lab = db.getSiblingDB("keplergrid_practice")
lab.usageOrders.insertMany([
{ _id: "one", region: "east" },
{ _id: "two", region: "west" }
])
lab.usageOrders.createIndex({ region: 1 }, { name: "order_region" })
In KeplerGrid, open keplergrid_practice.usageOrders with a Read only connection.
Read the access count and observation window
Open Aggregation → JSON and run the pipeline. With access control enabled, use a MongoDB account authorized for index statistics, such as one with clusterMonitor in a monitoring setup. $indexStats must be the first stage.
[
{ "$indexStats": {} },
{ "$match": { "name": "order_region" } },
{ "$project": {
"_id": 0, "name": 1, "host": 1, "shard": 1,
"ops": "$accesses.ops", "since": "$accesses.since"
} }
]
Record ops and since. The count covers user operations observed on the reported node since that timestamp. In a sharded result, keep the shard and host with each row.
Generate two known index accesses and compare
In the same mongosh session, run two reads against the same disposable server. The hint forces the practice index so you know which counter to inspect.
lab.usageOrders.find({ region: "east" }).hint("order_region").toArray()
lab.usageOrders.find({ region: "west" }).hint("order_region").toArray()
Rerun the pipeline and check that the practice index’s count increased on the same node. In a live environment, restarts and some index changes can reset statistics. A zero count from one node or a short window is insufficient evidence that an index can be removed.
See how to test a suspected unused index by hiding it or revisit the related KeplerGrid walkthrough.