wonderfuljamesjin opened a new issue #755: Age time calculate results are not 
updated in the couchdb view
URL: https://github.com/apache/couchdb/issues/755
 
 
   Hi
   
   I need calculate the time age days based on the couchdb document : 
doc.lastupdate with current day, I defined the couchdb map view as following, I 
did not know why the results not update/refresh everyday? like the 
doc.lastupdate =2017-08-16 23:15:1, but today it still see the results as 0 age 
day? only after I change the view and save it, the result can be taken effect 
as expected, I know there is a setting in couched stale=update_after, but it is 
not working,  please help figure out the issue, thanks a lot
   
   ```
   function(doc) {
       if (doc.type) {
          new_date = doc.lastupdate;
         var date_arr = new_date.split(" ");
         var date_aar2 = date_arr[0];
         date_aar2 = new Date(date_aar2.replace(/-/g, "/"));
         date_aar1 = new Date();
         var days = date_aar1.getTime() - date_aar2.getTime();
         var age = parseInt(days / (1000 * 60 * 60 * 24));
         emit(date_aar2,age);
          }
      }
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to