couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Jörg Schmidt <schm...@netzmerk.com>
Subject Re: commonjs in validation docs
Date Sat, 01 Jun 2013 09:19:12 GMT
Yes, you can use CommonJS modules inside validate_doc_update functions.
The docs are a bit misleading in this case.

{
  "lib": {
    "validation": "exports.presence = ..."
  },
  "validate_doc_update": "function(doc) {
require('lib/validation').presence(doc, 'title') }"
}

g jo
Am 01.06.2013 03:14 schrieb "Stephen Bartell" <snbartell@gmail.com>:

> Hi all!
>
> Can I use cjs modules in validate_doc_update functions?
>
> I had a look through the docs at
> http://couchdb.readthedocs.org/en/latest/query-servers.html#commonjs-modulesand it seems
to suggest that I can have a validate_doc_update function
> inside a view field.  I tried this and the validation doesn't seem to run.
>  Is this supposed to work?
>
> Thanks!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message