incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Bénel <aurelien.be...@utt.fr>
Subject Re: commonjs in validation docs
Date Mon, 03 Jun 2013 07:21:40 GMT
Hi Stephen,

> So I can't seem to get a validate_update_doc nested in a view field to work.  

Why would you do that? Validations and views are completely different concepts.

>   "views": {
>       "validate_doc_update": "function(newdoc, olddoc, ctx, sec) {throw {forbidden: 'You
shall not pass.'}}" // this one doesn't work

If you write this, `validate_doc_update` will be just a view. I'm pretty sure this is not
what you want.
As a view, it should have a map and could have a reduce function, but would have nothing to
do with validation.
 

Regards,

Aurélien


Mime
View raw message