You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by George Burt <im...@gmail.com> on 2011/02/08 21:17:41 UTC

Can a validation function alter the new document?

Just thought I would ask.  If not, is there any way to apply javascript to
the document before it is saved (from inside couchDB).

-- George

Re: Can a validation function alter the new document?

Posted by George Burt <im...@gmail.com>.
That's exactly what I needed.  Thanks!

On Tue, Feb 8, 2011 at 3:20 PM, Paul Davis <pa...@gmail.com>wrote:

> On Tue, Feb 8, 2011 at 3:17 PM, George Burt <im...@gmail.com> wrote:
> > Just thought I would ask.  If not, is there any way to apply javascript
> to
> > the document before it is saved (from inside couchDB).
> >
> > -- George
> >
>
> No, you can't edit docs from validation functions.
>
> You can use _update handlers to do some stuff, but you have to use
> them as the endpoint, there's nothing that hooks into the normal PUT
> document code paths.
>



-- 
George Burt
President
TrueShot Enterprises, LLC.
(386) 208-1309
Fax (213) 477-2195
www.TrueShot.com
12756 92nd Ter
Live Oak, FL 32060

Re: Can a validation function alter the new document?

Posted by Paul Davis <pa...@gmail.com>.
On Tue, Feb 8, 2011 at 3:17 PM, George Burt <im...@gmail.com> wrote:
> Just thought I would ask.  If not, is there any way to apply javascript to
> the document before it is saved (from inside couchDB).
>
> -- George
>

No, you can't edit docs from validation functions.

You can use _update handlers to do some stuff, but you have to use
them as the endpoint, there's nothing that hooks into the normal PUT
document code paths.