Files
mongo/jstests/core/query/date/date2.js
Steve McClure 1ffbc6c2e9 SERVER-109432: Autofix JS var usage to favor let (#40637)
GitOrigin-RevId: 9674b7db36a0f3f650d39c1e3fb2ad6ff2141cfb
2025-08-28 19:21:01 +00:00

15 lines
392 B
JavaScript

// Check that it's possible to compare a Date to a Timestamp, but they are never equal - SERVER-3304
// @tags: [
// requires_getmore,
// ]
let t = db.jstests_date2;
t.drop();
t.createIndex({a: 1});
let obj = {a: new Timestamp(0, 1)}; // in old versions this was == to new Date(1)
t.save(obj);
assert.eq(0, t.find({a: {$gt: new Date(1)}}).itcount());
assert.eq(1, t.find(obj).itcount());