massage-couch1.1.2 • Public • Published
Take a break and let me massage your CouchDB documents.
I am a streaming couch-daemon under the control of your couch.
npm install massage-couch -g
You can run Massage Couch from the commandline:
The options explained above can be given as commandline parameters (prefixed with
--) or environment variables (UPPERCASED).
massage-couch --username bernd --password secure --whitelist projects
Add Massage Couch to the
os_daemons config section (eg. in local.ini):
[os_daemons]massage-couch = massage-couch
Now CouchDB takes care of the Massage Couch process.
[massage-couch]; Optional username and password, used by the workers to access the databaseusername = mein-userpassword = secure; Only documents in the databases below are processed (separate with comma).; Regular expressions are allowed:;whitelist = mydb,otherdb,/^special-.*/; Ignore the following databases (again comma separated list); Regular expressions are again allowed:blacklist = /^_/
massage-couch property to a design document.
Massage Couch will process all databases which have a design document with such
As you see you can define different masseurs under a
Each masseur will be run, but there is no special order in which they are
A masseur function receives three arguments:
doc: the document received from the changes feed (the changes feed runs with
include_docs = true)
db: a nano adapter, pointing to the db where the doc comes from
done: MUST be called after completion (the masseur function is run through event-stream map)
Test your code with
You can set a different CouchDB url (and authentication credentials) via
COUCH environment variable:
COUCH=http://user:password@localhost:5984 npm test
Copyright (c) 2014 Johannes J. Schmidt, null2 GmbH
Licensed under the MIT license.