November 2013
Intermediate to advanced
148 pages
3h 12m
English
Different databases offer different ways of querying data, but most include some concept of indexing. When you index data in a database, you make it available for quick retrieval by some field or attribute of the data.
With CouchDB, you write mapreduce functions, which produce views. A view is a kind of index that maps values back to documents. With a view, you can query for documents with particular attributes or fields—like finding a book by its author.
We’ll create two views for our Gutenberg data set: one for finding books by author, and one for finding books on a given subject. Since CouchDB views consist of JavaScript code, we’ll keep them in a Node.js module and write a small utility program for loading ...
Read now
Unlock full access