summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/shell_advance_cluster_time.js
blob: c0d4580aae5807f863c1c15fb0cc1f8b0ecc2553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * Santity check getClusterTime and advanceClusterTime.
 */

(function() {
assert.throws(function() {
    db.getMongo().advanceClusterTime();
});

assert.throws(function() {
    db.getMongo().advanceClusterTime(123);
});

assert.throws(function() {
    db.getMongo().advanceClusterTime('abc');
});

db.getMongo().advanceClusterTime({'clusterTime': 123});

assert.eq({'clusterTime': 123}, db.getMongo().getClusterTime());

db.getMongo().advanceClusterTime({'clusterTime': 100});

assert.eq({'clusterTime': 123}, db.getMongo().getClusterTime());

db.getMongo().advanceClusterTime({'clusterTime': 456});

assert.eq({'clusterTime': 456}, db.getMongo().getClusterTime());
})();