mikeal / node.couchapp.js

Utility for writing couchapps.
Apache License 2.0
406 stars 78 forks source link

Where to put validate_doc_update function? #3

Open ghost opened 13 years ago

ghost commented 13 years ago

I have generated an couchapp folder.

Where do I put validate_doc_update function?

shimaore commented 13 years ago

At the root of the couchapp document; in coffee-script terms:

ddoc = 
  _id: "_design/app'

module.exports = ddoc

ddoc.validate_doc_update = (newDoc, oldDoc, userCtx) ->
  # Do something here