incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Marino <mmar...@gmail.com>
Subject Re: CouchDB: Timestamp inaccurate and seems to be cached
Date Wed, 08 Jan 2014 14:36:07 GMT
It's not exactly clear what you would like to do.  Do you just want to get
the timestamp as seen by the couchdb server?

What you are doing here is writing a view, the results of which will only
be regenerated if a new document has been inserted between a previous query
and the current query.

On Wed, Jan 8, 2014 at 3:17 PM, Hank Knight <hknight555@gmail.com> 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?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message