I've read about validations (validate_doc_update) we can create on CouchDB, however I didn't figure out how I can create them. Can I do it through Fauxton?
Databases -> "mydb" -> Design Documents -> New Doc
Is this the way? Must I declare the function as string? I need an example please (there is any step-by-step in the docs).
Thanks.
I figured this out. Here is the step-by-step:
Through Fauxton
Navigate to: Databases -> [select your database name here] -> All Documents -> New Doc, then fill up the text area with your desired validation using the JSON boilerplate below and click Save:
Through curl
Important: The DocID must be prefixed by "_design/" and the key of the function must be "validate_doc_update". Note the function as string.
After the validation set, if we try to create a document you must see the error "not able now!"..