I am trying to work with CouchDB
filtering but I can not understand how it works
So lets say, like the example they have:
function(doc, req){
// we need only `mail` documents
if (doc.type != 'mail'){
return false;
}
// we're interested only in `new` ones
if (doc.status != 'new'){
return false;
}
return true; // passed!
}
I am bit confused because if I want to return only
mail documents
I think I should implement something like:
if (doc.type == 'mail'){
return true;
}
At the end we have
return true //passed
but, is that mean that I will return all the documnents I have?