I have the following code:
var dates = getDates();
var a = dates.now;
var tomorrow = dates.tomorrow;
console.log("{userid: " + userid + ", time: {$gte: " + a + "}, time: {$lte: " + tomorrow +"}");
tickets.find({userid: userid, time: {$gte: a}, time: {$lte: tomorrow}}).then(function (usertickets) {
console.log(usertickets[0]);
return resolve(usertickets);
});
console log:
{userid: 57e0fa234f243f0710043f8f, time: {$gte: 1476309600000}, time:
{$lte: 1476396000000}
console log result output:
{ userid: '57e0fa234f243f0710043f8f',
username: 1,
fromticket: 1,
amount: 1,
toticket: 2,
time: '1474362076461',
__v: 0,
_id: 57e0fadce32462ca1036274d }
Q: How come that time 1474362076461 is in results, while it should be results greather or equal to 1476309600000 and lower than 1476396000000 ?