CouchDB supports notifications when documents change: changes the feed .
You can poll the change channel with parameter ?since=X to get only updates from X.
You can also "long poll" the feed by adding &feed=longpoll . If there are no changes yet, CouchDB will receive your request, but will not respond until, finally, the change occurs.
Or you can have a full COMET style stream by adding &feed=continuous . This is similar to longpoll, however CouchDB never closes the connection. Each time a change occurs, it sends you JSON and then continues to wait.
Finally, you can receive notifications of any changes in the database or point to the Javascript filter to run on the server ( &filter=designdoc/filtername ). You will only receive notifications if the filter approves.
source share