-
Notifications
You must be signed in to change notification settings - Fork 4
Searching
Upkar Lidder edited this page May 8, 2019
·
3 revisions
Search by country and reduce using _count
function (doc) {
if(doc.country) {
emit(doc.country, {"first_name":doc.first_name, "last_name":doc.last_name,"country":doc.country});
}
}
Search by age and reduce using count to get a histogram
function (doc) {
if(doc.age){
emit(doc.age, doc.age);
}
}
country and age
function (doc) {
if(doc.country && doc.age) {
emit([doc.country, doc.age], {"first_name":doc.first_name, "last_name":doc.last_name});
}
}
- List all users from Albania who are 30 year or less
- How many males and females in each country ?
- Return all users that do not have a postal_code
- List all users with country starting with B