diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-02-12 18:39:46 -0500 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2018-02-27 11:16:08 -0500 |
commit | a77297dbe34d5cd838a4da55e9d83dc70c510bba (patch) | |
tree | 31af6e80ce89e6f0cfdde8f5ea66691f1bb03bff /jstests/core/index_partial_create_drop.js | |
parent | f5c2680d3e3f28f4e32e2f5fbbbc61c39d55c2c8 (diff) | |
download | mongo-a77297dbe34d5cd838a4da55e9d83dc70c510bba.tar.gz |
SERVER-33174 Prevent catalog storage of new syntax during lower FCV
This will prevent the persistence of expressions introduced in 4.0
while the server is in feature compatibility version (FCV) 3.6.
Diffstat (limited to 'jstests/core/index_partial_create_drop.js')
-rw-r--r-- | jstests/core/index_partial_create_drop.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/jstests/core/index_partial_create_drop.js b/jstests/core/index_partial_create_drop.js index f3bc37efbd9..106a658c0f6 100644 --- a/jstests/core/index_partial_create_drop.js +++ b/jstests/core/index_partial_create_drop.js @@ -32,8 +32,11 @@ partialFilterExpression: {$and: [{$and: [{x: {$lt: 2}}, {x: {$gt: 0}}]}, {x: {$exists: true}}]} })); + // Use of $expr is banned in a partial index filter. assert.commandFailed( coll.createIndex({x: 1}, {partialFilterExpression: {$expr: {$eq: ["$x", 5]}}})); + assert.commandFailed(coll.createIndex( + {x: 1}, {partialFilterExpression: {$expr: {$eq: [{$trim: {input: "$x"}}, "hi"]}}})); for (var i = 0; i < 10; i++) { assert.writeOK(coll.insert({x: i, a: i})); |