summaryrefslogtreecommitdiff
path: root/jstests/core/update_with_pipeline.js
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-05-10 13:08:16 -0400
committerHenrik Edin <henrik.edin@mongodb.com>2019-05-10 13:08:16 -0400
commitc34bc93a15cbb6fe8b222f12afac5adbab6f0737 (patch)
tree73dfb5e8a30e14a079abcb8b485ef8881a4db316 /jstests/core/update_with_pipeline.js
parent5ec2e2508bec5cc64ea36f01f502c756c3e84597 (diff)
downloadmongo-c34bc93a15cbb6fe8b222f12afac5adbab6f0737.tar.gz
Revert "SERVER-40238 New stage alias: $set => $addFields"
This reverts commit bf6c2696da7eb207c28e83f5bb7401c97b0f69ac.
Diffstat (limited to 'jstests/core/update_with_pipeline.js')
-rw-r--r--jstests/core/update_with_pipeline.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/core/update_with_pipeline.js b/jstests/core/update_with_pipeline.js
index e0b6774a786..d9dae091835 100644
--- a/jstests/core/update_with_pipeline.js
+++ b/jstests/core/update_with_pipeline.js
@@ -50,7 +50,7 @@
testUpdate({
query: {_id: 1},
initialDocumentList: [{_id: 1, x: 1}],
- update: [{$set: {foo: 4}}],
+ update: [{$addFields: {foo: 4}}],
resultDocList: [{_id: 1, x: 1, foo: 4}],
nModified: 1
});
@@ -73,7 +73,7 @@
testUpdate({
query: {x: 1},
initialDocumentList: [{_id: 1, x: 1}, {_id: 2, x: 1}],
- update: [{$set: {bar: 4}}],
+ update: [{$addFields: {bar: 4}}],
resultDocList: [{_id: 1, x: 1, bar: 4}, {_id: 2, x: 1, bar: 4}],
nModified: 2,
options: {multi: true}
@@ -85,7 +85,7 @@
testUpdate({
query: {_id: {$in: [1, 2]}},
initialDocumentList: [{_id: 1, x: 1}, {_id: 2, x: 2}],
- update: [{$set: {bar: 4}}],
+ update: [{$addFields: {bar: 4}}],
resultDocList: [{_id: 1, x: 1, bar: 4}, {_id: 2, x: 2, bar: 4}],
nModified: 1,
options: {multi: false}
@@ -93,7 +93,7 @@
}
// Upsert performs insert.
- testUpsertDoesInsert({_id: 1, x: 1}, [{$set: {foo: 4}}], {_id: 1, x: 1, foo: 4});
+ testUpsertDoesInsert({_id: 1, x: 1}, [{$addFields: {foo: 4}}], {_id: 1, x: 1, foo: 4});
testUpsertDoesInsert({_id: 1, x: 1}, [{$project: {x: 1}}], {_id: 1, x: 1});
testUpsertDoesInsert({_id: 1, x: 1}, [{$project: {x: "foo"}}], {_id: 1, x: "foo"});
@@ -136,6 +136,6 @@
// The 'arrayFilters' option is not valid for pipeline updates.
assert.commandFailedWithCode(
- coll.update({_id: 1}, [{$set: {x: 1}}], {arrayFilters: [{x: {$eq: 1}}]}),
+ coll.update({_id: 1}, [{$addFields: {x: 1}}], {arrayFilters: [{x: {$eq: 1}}]}),
ErrorCodes.FailedToParse);
})();