Files
mongo/jstests/core/date2.js
Rishab Joshi 4329ffafa3 SERVER-50442 Remove ensureIndex shell function
This commit replaces all the usages of ensureIndex() with createIndex() in JS tests and JS shell""
2020-11-17 14:23:10 +00:00

12 lines
349 B
JavaScript

// Check that it's possible to compare a Date to a Timestamp, but they are never equal - SERVER-3304
t = db.jstests_date2;
t.drop();
t.createIndex({a: 1});
var 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());