summaryrefslogtreecommitdiff
path: root/src/mongo/db/update
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2017-09-09 11:38:46 -0400
committerJames Wahlin <james@mongodb.com>2017-09-10 20:16:34 -0400
commitd0f5e2b103a5f78967c460533f4f8850f02facd6 (patch)
tree285e0bf71e74d114c2255534f8a17e69cf7c1f0a /src/mongo/db/update
parent820abe30691f09011183b63ab63cb1e9c43f3d9e (diff)
downloadmongo-d0f5e2b103a5f78967c460533f4f8850f02facd6.tar.gz
SERVER-30951 Add top-level $expr to MatchExpression
Diffstat (limited to 'src/mongo/db/update')
-rw-r--r--src/mongo/db/update/pull_node_test.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/db/update/pull_node_test.cpp b/src/mongo/db/update/pull_node_test.cpp
index a00a80e394e..2fc996d05f1 100644
--- a/src/mongo/db/update/pull_node_test.cpp
+++ b/src/mongo/db/update/pull_node_test.cpp
@@ -101,10 +101,8 @@ TEST(PullNodeTest, InitWithGeoNearObjectFails) {
ASSERT_EQUALS(ErrorCodes::BadValue, status);
}
-// TODO SERVER-30951: Convert these tests to use top-level $expr and enable them.
-/*
TEST(PullNodeTest, InitWithExprElemFails) {
- auto update = fromjson("{$pull: {a: {$expr: 5}}}");
+ auto update = fromjson("{$pull: {a: {$expr: {$eq: [5, 5]}}}}");
const CollatorInterface* collator = nullptr;
PullNode node;
auto status = node.init(update["$pull"]["a"], collator);
@@ -113,14 +111,13 @@ TEST(PullNodeTest, InitWithExprElemFails) {
}
TEST(PullNodeTest, InitWithExprObjectFails) {
- auto update = fromjson("{$pull: {a: {b: {$expr: 5}}}}");
+ auto update = fromjson("{$pull: {a: {$expr: {$eq: ['$a', {$literal: {b: 5}}]}}}}");
const CollatorInterface* collator = nullptr;
PullNode node;
auto status = node.init(update["$pull"]["a"], collator);
ASSERT_NOT_OK(status);
ASSERT_EQUALS(ErrorCodes::BadValue, status);
}
-*/
TEST_F(PullNodeTest, TargetNotFound) {
auto update = fromjson("{$pull : {a: {$lt: 1}}}");