Hi all , my view is as following,
function (doc, meta) {
if(doc._type=='couponGame') {
var today = new Date().toJSON().slice(0,10);
var gameDate = new Date(doc.createdat).toJSON().slice(0,10);
if(gameDate == today)
{
emit(doc.email,meta.id);
}
}
}
lets say it was working fine yesterday, but today also it is giving yesterday’s result only.even after stale set to false. it starts working fine if force indexing manually by publishing the entire design doc. is it possible that the variable today is calculated only once when the view is published?
Thanks .