I want to compare ISODate in collection.
Please example Collection. find(.....)
.
var oneMonthFromNow = moment().add(1, 'month').toDate();
Collection.find({
startDate: { $gt: new Date },
endDate: { $lt: oneMonthFromNow }
});
1 Like
var now = new Date();
var anHourAgo = new Date(now.setHours(now.getHours - 1));
var cursor = Collection.find({
createdAt:{$lte:anHourAgo}
})l
Thanks I will try…