Comparison ISODate in collection?


#1

I want to compare ISODate in collection.
Please example Collection. find(.....).


#2
var oneMonthFromNow = moment().add(1, 'month').toDate();
Collection.find({
  startDate: { $gt: new Date },
  endDate: { $lt: oneMonthFromNow }
});

#3
var now = new Date();
var anHourAgo = new Date(now.setHours(now.getHours - 1));

var cursor = Collection.find({
                 createdAt:{$lte:anHourAgo}
             })l

#4

Thanks I will try…