July 2012
Beginner to intermediate
342 pages
7h 27m
English
One of CouchDB's most noteworthy features is the _changes API. With it we can view all alterations to a database via HTTP.
For instance, to see all changes made to our quotes database we can make a GET request to http://localhost:5984/quotes/_changes. Even better, if we wanted to hook up to a live stream, we would add the query parameter ?feed=continuous.
Cradle provides an attractive interface to the _changes API, which we'll explore in this recipe.
We'll need a functioning CouchDB database and a way to write to it. We can use the quotes.js example used in Storing data to CouchDB with Cradle, so let's copy that into a new directory and then create a file alongside it called quotes_stream.js ...
Read now
Unlock full access