Jason,
You'll want something like:
{
"_id": "_design/foo",
"views": {
"bar": "function(doc) {if(doc.attribute) emit(doc.attribute, null);}"
}
}
After saving that you can use a URL like:
http://127.0.0.1:5984/db_name/_design/foo/_view/bar?key=user_input
And you'll get the list of docs that have that attribute.
HTH,
Paul Davis
On Wed, Apr 15, 2009 at 1:15 PM, Jason Tahaney
<[email protected]> wrote:
> Hello,
>
> Very new to couchdb. Can someone please tell me how I would represent a
> search for an attribute value (say from user input) in a design view? Are
> design views static (everything I read points to yes)? I'm probably trying
> to use the wrong feature. Just looking for a way to say search where
> attribute=value and value comes from user input.
>
> Thanks,
>
> Jason
>