summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorKyle Suarez <kyle.suarez@mongodb.com>2017-08-07 16:50:41 -0400
committerKyle Suarez <kyle.suarez@mongodb.com>2017-08-08 08:53:15 -0400
commitd4ce0f7427e137f1a12b39a0889a468dc2169b6b (patch)
treed2ae23ae0a5530e6c4561044078eda1e6bb4fecb /src/mongo/db/pipeline
parent8962beb1b8f8ca869a9f7ccdc4a7eeab2b84c2f4 (diff)
downloadmongo-d4ce0f7427e137f1a12b39a0889a468dc2169b6b.tar.gz
SERVER-30034 create a $_internalSchemaMatchArrayIndex match expression
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/document_source_match.cpp1
-rw-r--r--src/mongo/db/pipeline/document_source_match_test.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document_source_match.cpp b/src/mongo/db/pipeline/document_source_match.cpp
index c67b65c8d23..38c78d8ad30 100644
--- a/src/mongo/db/pipeline/document_source_match.cpp
+++ b/src/mongo/db/pipeline/document_source_match.cpp
@@ -268,6 +268,7 @@ Document redactSafePortionDollarOps(BSONObj expr) {
case PathAcceptingKeyword::INTERNAL_SCHEMA_OBJECT_MATCH:
case PathAcceptingKeyword::INTERNAL_SCHEMA_MIN_LENGTH:
case PathAcceptingKeyword::INTERNAL_SCHEMA_MAX_LENGTH:
+ case PathAcceptingKeyword::INTERNAL_SCHEMA_MATCH_ARRAY_INDEX:
continue;
}
}
diff --git a/src/mongo/db/pipeline/document_source_match_test.cpp b/src/mongo/db/pipeline/document_source_match_test.cpp
index 33e10840ecd..6eb793d76d6 100644
--- a/src/mongo/db/pipeline/document_source_match_test.cpp
+++ b/src/mongo/db/pipeline/document_source_match_test.cpp
@@ -118,6 +118,11 @@ TEST_F(DocumentSourceMatchTest, RedactSafePortion) {
assertExpectedRedactSafePortion("{a: {$_internalSchemaFmod: [4.5, 2.3]}}", "{}");
+ assertExpectedRedactSafePortion(
+ "{a: {$_internalSchemaMatchArrayIndex:"
+ "{index: 0, namePlaceholder: 'i', expression: {i: {$gt: 0}}}}}",
+ "{}");
+
// Combinations
assertExpectedRedactSafePortion("{a:1, b: 'asdf'}", "{a:1, b: 'asdf'}");