summaryrefslogtreecommitdiff
path: root/jstests/sharding/all_collection_stats.js
diff options
context:
space:
mode:
authorPol Pinol Castuera <pol.castuera@mongodb.com>2022-09-09 07:38:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-09 08:14:29 +0000
commit1e7c15df90aea5be2a75d86f2c55bcac1c29edc7 (patch)
treee4bdc86ba2f9e09ffefdaa671bf4c9a80201738d /jstests/sharding/all_collection_stats.js
parenta7ba740894c9d935e441371bdfaca341eed761dd (diff)
downloadmongo-1e7c15df90aea5be2a75d86f2c55bcac1c29edc7.tar.gz
SERVER-69465 Accept same specs for $_internalAllCollectionStats as $collStats
Diffstat (limited to 'jstests/sharding/all_collection_stats.js')
-rw-r--r--jstests/sharding/all_collection_stats.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/jstests/sharding/all_collection_stats.js b/jstests/sharding/all_collection_stats.js
index 76018cb4b58..02637bede16 100644
--- a/jstests/sharding/all_collection_stats.js
+++ b/jstests/sharding/all_collection_stats.js
@@ -1,5 +1,5 @@
/*
- * Test to validate the $_internalAllCollectionStats stage.
+ * Test to validate the $_internalAllCollectionStats stage for storageStats.
*
* @tags: [
* requires_fcv_62,
@@ -31,7 +31,8 @@ for (let i = 10; i < 20; i++) {
}
// Get output data
-const outputData = adminDb.aggregate([{$_internalAllCollectionStats: {}}]).toArray();
+const outputData =
+ adminDb.aggregate([{$_internalAllCollectionStats: {stats: {storageStats: {}}}}]).toArray();
assert.gte(outputData.length, 20);
// Testing for comparing each collection returned from $_internalAllCollectionStats to $collStats
@@ -62,10 +63,12 @@ assert.commandFailedWithCode(
adminDb.runCommand({aggregate: 1, pipeline: [{$_internalAllCollectionStats: 3}], cursor: {}}),
6789103);
-const response = assert.commandFailedWithCode(
- testDb.runCommand(
- {aggregate: "foo", pipeline: [{$_internalAllCollectionStats: {}}], cursor: {}}),
- 6789104);
+const response = assert.commandFailedWithCode(testDb.runCommand({
+ aggregate: "foo",
+ pipeline: [{$_internalAllCollectionStats: {stats: {storageStats: {}}}}],
+ cursor: {}
+}),
+ 6789104);
assert.neq(-1, response.errmsg.indexOf("$_internalAllCollectionStats"), response.errmsg);
assert.neq(-1, response.errmsg.indexOf("admin database"), response.errmsg);