diff options
author | Ian Boros <puppyofkosh@gmail.com> | 2019-05-13 18:19:38 -0400 |
---|---|---|
committer | Ian Boros <puppyofkosh@gmail.com> | 2019-05-20 15:50:22 -0400 |
commit | 31967340abb31476910730163c04782f2e915d01 (patch) | |
tree | e21db441abdfbdf707f66f640796e3d8ee6ab6a8 /jstests | |
parent | 24760ca934a3c7843731de117839070ddf7fd3cc (diff) | |
download | mongo-31967340abb31476910730163c04782f2e915d01.tar.gz |
SERVER-40949 add LookupAllowed stage constraint
This bans $merge and $sB from $lookup subpipelines
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/change_streams/ban_from_lookup.js | 7 | ||||
-rw-r--r-- | jstests/sharding/change_streams.js | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/jstests/change_streams/ban_from_lookup.js b/jstests/change_streams/ban_from_lookup.js index 08bc600ad55..b799c3ce169 100644 --- a/jstests/change_streams/ban_from_lookup.js +++ b/jstests/change_streams/ban_from_lookup.js @@ -13,9 +13,8 @@ assert.writeOK(coll.insert({_id: 1})); // Verify that we cannot create a $lookup using a pipeline which begins with $changeStream. - assertErrorCode(coll, - [{$lookup: {from: foreignColl, as: 'as', pipeline: [{$changeStream: {}}]}}], - ErrorCodes.IllegalOperation); + assertErrorCode( + coll, [{$lookup: {from: foreignColl, as: 'as', pipeline: [{$changeStream: {}}]}}], 51047); // Verify that we cannot create a $lookup if its pipeline contains a sub-$lookup whose pipeline // begins with $changeStream. @@ -31,5 +30,5 @@ ] } }], - ErrorCodes.IllegalOperation); + 51047); })(); diff --git a/jstests/sharding/change_streams.js b/jstests/sharding/change_streams.js index 142b621f1fe..98039231687 100644 --- a/jstests/sharding/change_streams.js +++ b/jstests/sharding/change_streams.js @@ -46,8 +46,7 @@ [{$changeStream: {}}, {$group: {_id: '$documentKey'}}], ErrorCodes.IllegalOperation); - // Test that using change streams with any stages not allowed to run on mongos results in an - // error. + // Test that using change streams with $out results in an error. assertErrorCode( mongosColl, [{$changeStream: {}}, {$out: "shouldntWork"}], ErrorCodes.IllegalOperation); |