I need to find only that data, Availability date is greater than my current date. where do I put $gte
function getBookingList(){
return new Promise(function(resolve,reject){
Booking.find(
{userId: req.userId}
).populate({
path:'expId',
model:Experiences
}).populate({
path:'slotId',
model:Availability
}).exec(function(err,result){
if(err){
reject(err);
}if(result){
resolve(result);
}else{
resolve({"msg":"Booking Experiences not found."});
}
});
});
}
I find the today date to compare.
var today = new Date(new Date().setHours(0,0,0,0));;
var todaynew = today.toISOString();
and I know by using
date: {$gte: todaynew}
above I can get it but where do I put in my query?