couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <zachary.zol...@gmail.com>
Subject Re: Create date of a document
Date Wed, 22 Sep 2010 20:40:59 GMT
You are correct; validation functions cannot modify documents.

On Wed, Sep 22, 2010 at 3:06 PM, sleepy <wanpeebaw@gmail.com> wrote:
> Thanks for your answer.
>
> I tried to add a date in an update handler and it works.
> Now I'm curious. Can I add create date using validation function?
>
> It seems Couch doesn't allow me to change the doc in a validation function.
>
> 2010/9/23 Mirko Kiefer <mirko.kiefer@arcor.de>
>
>> Hi, you can simply get the date through
>> var date = new Date();
>>
>> the object is documented here:
>> http://www.w3schools.com/js/js_obj_date.asp
>>
>> On Sep 22, 2010, at 5:35 PM, sleepy wrote:
>>
>> > Is there a way to get server time in validation function? I need that
>> > information in order to avoid data with future date-time
>> > Or can I record create date of a document using server time which is
>> ensured
>> > by server?
>> >
>> > sleepnova
>>
>>
>

Mime
View raw message