summaryrefslogtreecommitdiff
path: root/jstests/aggregation/expressions/indexof_codepoints.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/aggregation/expressions/indexof_codepoints.js')
-rw-r--r--jstests/aggregation/expressions/indexof_codepoints.js20
1 files changed, 5 insertions, 15 deletions
diff --git a/jstests/aggregation/expressions/indexof_codepoints.js b/jstests/aggregation/expressions/indexof_codepoints.js
index 20b9534b050..506b1a13cfa 100644
--- a/jstests/aggregation/expressions/indexof_codepoints.js
+++ b/jstests/aggregation/expressions/indexof_codepoints.js
@@ -15,9 +15,7 @@ load("jstests/aggregation/extras/utils.js"); // For assertErrorCode and testExp
var input = indexOfSpec[0];
var token = indexOfSpec[1];
var start = indexOfSpec.length > 2 ? indexOfSpec[2] : 0;
- var end = indexOfSpec.length > 3 ? indexOfSpec[3] : {
- $strLenCP: input
- };
+ var end = indexOfSpec.length > 3 ? indexOfSpec[3] : {$strLenCP: input};
var substrExpr = {
$indexOfCP: [{$substrCP: [input, start, {$subtract: [end, start]}]}, token]
@@ -107,23 +105,15 @@ load("jstests/aggregation/extras/utils.js"); // For assertErrorCode and testExp
};
assertErrorCode(coll, pipeline, 40094);
- pipeline = {
- $project: {output: {$indexOfCP: ["abc", "b", "bad"]}}
- };
+ pipeline = {$project: {output: {$indexOfCP: ["abc", "b", "bad"]}}};
assertErrorCode(coll, pipeline, 40096);
- pipeline = {
- $project: {output: {$indexOfCP: ["abc", "b", 0, "bad"]}}
- };
+ pipeline = {$project: {output: {$indexOfCP: ["abc", "b", 0, "bad"]}}};
assertErrorCode(coll, pipeline, 40096);
- pipeline = {
- $project: {output: {$indexOfCP: ["abc", "b", -1]}}
- };
+ pipeline = {$project: {output: {$indexOfCP: ["abc", "b", -1]}}};
assertErrorCode(coll, pipeline, 40097);
- pipeline = {
- $project: {output: {$indexOfCP: ["abc", "b", 1, -1]}}
- };
+ pipeline = {$project: {output: {$indexOfCP: ["abc", "b", 1, -1]}}};
assertErrorCode(coll, pipeline, 40097);
}());