diff options
author | David Storch <david.storch@10gen.com> | 2018-02-28 18:08:21 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2018-03-09 17:20:42 -0500 |
commit | ed1e2b4d2a4987e3744484f9482fdc7a0e119e94 (patch) | |
tree | 8096db9198fb62cd62e2192a38b15faf3d5100a6 /jstests/noPassthrough/read_concern_snapshot_yielding.js | |
parent | b9e20190b647fea262a8f4e154bbf18d9934a3ba (diff) | |
download | mongo-ed1e2b4d2a4987e3744484f9482fdc7a0e119e94.tar.gz |
SERVER-33541 Add readConcern level 'snapshot' support for aggregation.
Diffstat (limited to 'jstests/noPassthrough/read_concern_snapshot_yielding.js')
-rw-r--r-- | jstests/noPassthrough/read_concern_snapshot_yielding.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/noPassthrough/read_concern_snapshot_yielding.js b/jstests/noPassthrough/read_concern_snapshot_yielding.js index aa953e11927..dc600721b59 100644 --- a/jstests/noPassthrough/read_concern_snapshot_yielding.js +++ b/jstests/noPassthrough/read_concern_snapshot_yielding.js @@ -237,6 +237,19 @@ res.cursor.nextBatch.length, TestData.numDocs - initialFindBatchSize, tojson(res)); }, {"originatingCommand.filter": {x: 1}}, {op: "getmore"}); + // Test aggregate. + testCommand(function() { + const res = assert.commandWorked(db.runCommand({ + aggregate: "coll", + pipeline: [{$match: {x: 1}}], + readConcern: {level: "snapshot"}, + cursor: {}, + lsid: TestData.sessionId, + txnNumber: NumberLong(TestData.txnNumber) + })); + assert.eq(res.cursor.firstBatch.length, TestData.numDocs, tojson(res)); + }, {"command.pipeline": [{$match: {x: 1}}]}, {"command.pipeline": [{$match: {x: 1}}]}); + // Test update. // We cannot provide a 'profilerFilter' because profiling is turned off for write commands in // transactions. |