summaryrefslogtreecommitdiff
path: root/jstests/sharding
diff options
context:
space:
mode:
authorTyler Brock <tyler.brock@gmail.com>2023-01-29 18:00:36 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-29 18:42:13 +0000
commitf6897efb24aea4d923b6646b2379fa64dd041480 (patch)
tree9e917d83155c748b7771e6e75e4dd8dd11877075 /jstests/sharding
parent5cb6cc2e6373272bf7fa3ac2f8e364910abedf93 (diff)
downloadmongo-f6897efb24aea4d923b6646b2379fa64dd041480.tar.gz
SERVER-72620 ensure shard added to $indexStats for unsharded collections
Diffstat (limited to 'jstests/sharding')
-rw-r--r--jstests/sharding/timeseries_cluster_indexstats.js8
1 files changed, 1 insertions, 7 deletions
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)}`);
});