Skip to content

simple jQuery plugin that let you add event handler on CouchDB changes feed

Notifications You must be signed in to change notification settings

koleto/couchdb.changes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 

Repository files navigation

#CouchDB Changes

A JQuery plugin for binding event handlers to the CouchDB _changes feed.

Features

  • Bind an event handler to a database _changes longpoll feed.
  • Bind an event handler for monitoring of a specific document changes.

TODO

Usage

  • $.couchdb.changes.database(database, callback):

    $.couchdb.changes.database("test", function(changes){
         $('ul').append("
  • " + changes.last_seq + "
  • "); });
    • $.couchdb.changes.document(database, document, callback):
    
        $.couchdb.changes.document("test", "test-doc", function(doc){
             $('ul').append("
  • " + doc._rev + "
  • "); });

    Stopped working on the pluggin because of the jquery.couch.js include changes feature as well.

    Note that this is not included in the plugin shipped with CouchDB 0.11.0!

    Here is a code snippet that shows how to use this:

    
    	
    	// database changes
    	$.couch.db('test').changes().onChange(function(resp){
    		console.log(resp);
    	});
    	
    	// include the documents
    	$.couch.db('test').changes(null, { "include_docs" : "true" }).onChange(function(resp){
    		console.log(resp);
    	});
    	
    	
    

    About

    simple jQuery plugin that let you add event handler on CouchDB changes feed

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published