summaryrefslogtreecommitdiff
path: root/jstests/core/read_after_optime.js
blob: 579915e57357c4415439b5cfaae99d09d935bdad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test that attempting to read after optime fails if replication is not enabled.
// @tags: [
//   multiversion_incompatible,
//   assumes_standalone_mongod,
// ]

(function() {
"use strict";

var currentTime = new Date();

var futureOpTime = new Timestamp((currentTime / 1000 + 3600), 0);

assert.commandFailedWithCode(
    db.runCommand(
        {find: 'user', filter: {x: 1}, readConcern: {afterOpTime: {ts: futureOpTime, t: 0}}}),
    [ErrorCodes.NotAReplicaSet, ErrorCodes.NotImplemented]);
})();