CouchDB is my personal favorite of the new breed of “NoSQL” databases.  Here are my slides for my CouchDB presentation at the TEC 20ii conference:

Cloud Programming: CouchDB

If you’re following along you might want to copy and paste from these examples:

Our First Design Document’s Stub:

{ "people": { "map": "function(doc) {}" } }

Our First View:

function (doc) {
if (doc.name) {
emit(doc.name, doc._rev);
}
}

Our Second View’s Stub: (pasted into the design document; slide 48)

"parties": { "map": "function(doc) {}" }

Our Second View:

function (doc) {
if (doc.party) {
emit(doc.party, 1);
}
}

Our First Reduce Function:

function (key, values, rereduce) {
return sum (values);
}

Advertisement