February 2015
Intermediate to advanced
170 pages
3h 39m
English
Up until this point, we've written most of our map functions to emit null for the value side of our key/value views. We've also learnt that it's best to use views as a means to retrieve a document via the key/value API. However, there are exceptions to this rule.
Imagine that we've augmented our user documents to include an e-mail address, like this:
{
"firstName": "Sam",
"lastName": "Malone",
"email": "sam@example.com",
"type": "user"
}Now consider the task of creating some sort of scheduled job that needs to send a weekly e-mail to all users. We've already seen how to write the "select all users" query. Therefore, we know how to iterate over the set of users and retrieve the original user document to get this new e-mail property. ...
Read now
Unlock full access