Trigger after document update on couchDB
2 answers
CouchDB does not send requests (it only responds to them).
However, you can implement a working script (in node JS for example) that connects to CouchDB and modifies the feed using feed=longpolling
. Then you can keep listening for changes as they occur and react to them in any way you want - for example, send an HTTP request.
If you plan on implementing this in node, the follow npm package might be helpful .
+3
source to share
You might be able to implement this with PouchDB live sync
like below:
var localDB = new PouchDB('localdb')
var remoteDB = new PouchDB('http://192.168.1.106:5984/remotedb')
localDB.sync(remoteDB, {
live: true,
retry: true
}).on('change', function (change) {
// Something changed
// trigger appropriate events here
})
0
source to share