summaryrefslogtreecommitdiff
path: root/jstests/sharding
diff options
context:
space:
mode:
authorPol Pinol Castuera <pol.pinol@mongodb.com>2022-11-24 07:37:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-24 08:20:16 +0000
commit1557a827b0ea179cf64b3e4139169033e2181a59 (patch)
tree4b10be27f61f1584d3e69b02dbf9806580200429 /jstests/sharding
parent637fb52801843d2dc1b9dd212116d0ec2973e8d5 (diff)
downloadmongo-1557a827b0ea179cf64b3e4139169033e2181a59.tar.gz
SERVER-71477 Check '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs'
Diffstat (limited to 'jstests/sharding')
-rw-r--r--jstests/sharding/all_collection_stats.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/jstests/sharding/all_collection_stats.js b/jstests/sharding/all_collection_stats.js
index 5ef72a2dee8..2fd89236e70 100644
--- a/jstests/sharding/all_collection_stats.js
+++ b/jstests/sharding/all_collection_stats.js
@@ -67,6 +67,10 @@ for (let i = 0; i < 20; i++) {
assert(exists);
}
+// Test valid query with empty specification
+assert.commandWorked(
+ adminDb.runCommand({aggregate: 1, pipeline: [{$_internalAllCollectionStats: {}}], cursor: {}}));
+
// Test invalid queries/values.
assert.commandFailedWithCode(
adminDb.runCommand({aggregate: 1, pipeline: [{$_internalAllCollectionStats: 3}], cursor: {}}),