Search for items in collection based on time
Hi. I am working on a search function for my app, everything working just fine, if I insert the today date manually in mapping.
However, I have a problem, I want to tell the search function to only retrieve items where "START" is in the future from current date.
How can I do this in mapping? Insert "now.date" to the "where" query.
This is what I have so far:
code//need the today date to only retrieve items with start in the future. this is not working..
var today = new date();
//console.log(new date());
return '{"name":{"$regex":".' + value + '.", "$options":"i"}, "start" : {"$gt" :"2014-03-06 00:00:00.000"}}';/code