From f6897efb24aea4d923b6646b2379fa64dd041480 Mon Sep 17 00:00:00 2001 From: Tyler Brock Date: Sun, 29 Jan 2023 18:00:36 +0000 Subject: SERVER-72620 ensure shard added to $indexStats for unsharded collections --- jstests/sharding/timeseries_cluster_indexstats.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'jstests/sharding') diff --git a/jstests/sharding/timeseries_cluster_indexstats.js b/jstests/sharding/timeseries_cluster_indexstats.js index 32dd3c70752..339c618b599 100644 --- a/jstests/sharding/timeseries_cluster_indexstats.js +++ b/jstests/sharding/timeseries_cluster_indexstats.js @@ -59,13 +59,7 @@ function checkIndexStats(coll, keys, sharded) { keys.length, `There should be ${keys.length} indices on the collection.\n${tojson(indices)}`); indices.forEach((index, i) => { - assert.eq(index.hasOwnProperty('shard'), - sharded, - sharded - ? `Index stats 'shard' field should exist on a sharded collection.\n${ - tojson(index)}` - : `Index stats 'shard' field should not exist on a non-sharded collection.\n${ - tojson(index)}`); + assert(index.hasOwnProperty('shard'), tojson(index)); assert.docEq( keys[i], index.key, `Index should have key spec ${tojson(keys[i])}.\n${tojson(index)}`); }); -- cgit v1.2.1