0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/noPassthroughWithMongod/shell_advance_cluster_time.js
2019-07-27 11:02:23 -04:00

30 lines
677 B
JavaScript

/**
* 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());
})();