incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <>
Subject Re: CouchDB: Timestamp inaccurate and seems to be cached
Date Wed, 08 Jan 2014 14:33:57 GMT
You map function is only run when the data changes and the view needs to be rebuilt, so you’re
not recording the time when you access view but the time when the document was processed by
the view.  

Can you explain what you’re trying to achieve? Is there a reason you can’t get the current
time in the client application?   

On Wednesday, 8 January 2014 at 09:17, Hank Knight wrote:

> I use this Map Function to get the current Unix timestamp:
> function(doc) {emit(Math.round(new Date().getTime()/1000), null );}
> The odd thing is, it returns a correct timestamp the first time I run
> a query but it returns the exact same timestamp one minute later even
> though 60 seconds have passed! Is this due to caching or something
> else? What is the best way for me to always get the current Unix
> timestamp?

View raw message