summaryrefslogtreecommitdiff
path: root/jstests/core/views/views_count.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/views/views_count.js')
-rw-r--r--jstests/core/views/views_count.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/jstests/core/views/views_count.js b/jstests/core/views/views_count.js
index e7503e1d74d..ddf97ce0bb2 100644
--- a/jstests/core/views/views_count.js
+++ b/jstests/core/views/views_count.js
@@ -53,11 +53,10 @@
assert.commandWorked(explainPlan);
assert.eq(explainPlan["stages"][0]["$cursor"]["queryPlanner"]["namespace"], "views_count.coll");
+ // Count with hint works on a view.
+ assert.commandWorked(viewsDB.runCommand({count: "identityView", hint: "_id_"}));
+
assert.commandFailedWithCode(
viewsDB.runCommand({count: "identityView", collation: {locale: "en_US"}}),
ErrorCodes.OptionNotSupportedOnView);
-
- // Hint cannot be used when counting on a view.
- assert.commandFailedWithCode(viewsDB.runCommand({count: "identityView", hint: "_id_"}),
- ErrorCodes.InvalidPipelineOperator);
}());