February 2015
Intermediate to advanced
170 pages
3h 39m
English
We've seen the basics of key range queries but haven't fully explored how they work. Understanding range queries is critical in order to understand how to perform a number of common query tasks. We'll start by revisiting a basic range query. We'll use a simple document structure, as shown here:
{
"firstName": "Hank",
"lastName": "Moody",
"type": "user"
},
{
"firstName": "Karen",
"lastName": "Van Der Beek",
"type": "user"
},
{
"firstName": "Becca",
"lastName": "Moody-Smith",
"type": "user"
}In this example, we have three documents. We'll start by writing the map function, which will allow us to perform queries by last name. This is our standard view definition with a check on type and for the existence of a lastName property:
function ...
Read now
Unlock full access