incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: Automatic Unix Timestamp
Date Fri, 26 Jul 2013 15:40:10 GMT
Hi,

Use update functions for automatic fields setup on server side:
http://docs.couchdb.org/en/latest/ddocs.html#update-functions
--
,,,^..^,,,


On Fri, Jul 26, 2013 at 7:36 PM, Hank Knight <hknight555@gmail.com> wrote:
> How can I add a Unix Timestamp to a document, based on the server's clock?
>
> This gives me an error:
> JSON.parse: unexpected character
>
> {
>  "_id":"12345",
>  "user":"joe",
>  "unixtimestamp": Math.round(new Date().getTime()/1000),
>  "fruit":"peach"
> }

Mime
View raw message