couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Metson <simonmet...@googlemail.com>
Subject Re: Triggers
Date Wed, 26 May 2010 13:07:19 GMT
Hi,
	I do this in my application logic, rather than in the database. e.g.  
I just add a timestamp field before I POST/PUT the json document. You  
could then use a validation function to check that a date was added if  
you were really conscientious.
Cheers
Simon

On 26 May 2010, at 14:04, Guillaume Leprohon wrote:

> Hi!
>
> I'm trying to find a way to insert a timestamp field with every
> insert/update.  Because I can't rely on the user to provide valid  
> data,
> this information would have to be inserted while processing the  
> request
> on the server side (just like the _rev field).  In MySQL, I'm doing it
> with triggers (before insert / before update), but (unless I'm missing
> something), there is nothing that compares with triggers in CouchDB.
> And since validation functions are side-effect free, I can't use those
> to do it.  Any idea?
>
> Thanks,
>
> Guillaume Leprohon
>


Mime
View raw message