mapreduce - CouchDB filter timestamps in a reduce function - some sort of Date.now? -
can date.now type function used in either map or reduce functions? can used anywhere @ all? more specifically, view must not cache date.now value. here tested worked first run after change view function:
function (doc){ var n = new date(); if(doc.timestamp > n.gettime() - 30000){ emit(doc._id, doc); } }
the view rows refreshed when particular doc gets updated. can request view result: emit doc.timestamp key , request view ?startkey=timestamp timestamp value of now.gettime() - 30000.
Comments
Post a Comment