While Dominic's answer is true, the example in the actual question can probably be implemented as a map function with an appropriate key and a query that includes a startkey
. So if you want the functionality that you show in your example you should change your view to this:
function(doc) {
if( doc.property )
emit( doc.property, null);
}
And then your query would become:
/db_name/_design/view_doc/_view/view_name?startkey="property_param"&include_docs=true
Which would give you what your example suggests you're after.
This is the key (puns are funny) to working with CouchDB: create views that allow you to select subsets of the view based on the key using either key
, keys
or some combination of startkey
and/or endkey