diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-06-15 10:01:54 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-06-19 10:29:10 -0400 |
commit | ab165e7a81e319cd7e99af3e1eed86e826fd34ba (patch) | |
tree | 9bfbc962946848d8bc97d208e1aabdf0e0363915 /jstests/core/profile_findandmodify.js | |
parent | 0d7f9a01b1ae168b8adfc02bb1eb0c1616138d38 (diff) | |
download | mongo-ab165e7a81e319cd7e99af3e1eed86e826fd34ba.tar.gz |
SERVER-28762 Conditionally parse an update expression as an UpdateNode tree
Diffstat (limited to 'jstests/core/profile_findandmodify.js')
-rw-r--r-- | jstests/core/profile_findandmodify.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/jstests/core/profile_findandmodify.js b/jstests/core/profile_findandmodify.js index bca4b995553..8b431b50cdc 100644 --- a/jstests/core/profile_findandmodify.js +++ b/jstests/core/profile_findandmodify.js @@ -16,13 +16,13 @@ // coll.drop(); for (var i = 0; i < 3; i++) { - assert.writeOK(coll.insert({_id: i, a: i, b: i})); + assert.writeOK(coll.insert({_id: i, a: i, b: [0]})); } assert.commandWorked(coll.createIndex({b: 1})); - assert.eq({_id: 2, a: 2, b: 2}, coll.findAndModify({ + assert.eq({_id: 2, a: 2, b: [0]}, coll.findAndModify({ query: {a: 2}, - update: {$inc: {b: 1}}, + update: {$inc: {"b.$[i]": 1}}, collation: {locale: "fr"}, arrayFilters: [{i: 0}] })); @@ -32,7 +32,7 @@ assert.eq(profileObj.op, "command", tojson(profileObj)); assert.eq(profileObj.ns, coll.getFullName(), tojson(profileObj)); assert.eq(profileObj.command.query, {a: 2}, tojson(profileObj)); - assert.eq(profileObj.command.update, {$inc: {b: 1}}, tojson(profileObj)); + assert.eq(profileObj.command.update, {$inc: {"b.$[i]": 1}}, tojson(profileObj)); assert.eq(profileObj.command.collation, {locale: "fr"}, tojson(profileObj)); assert.eq(profileObj.command.arrayFilters, [{i: 0}], tojson(profileObj)); assert.eq(profileObj.keysExamined, 0, tojson(profileObj)); |