couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Tahaney <jtaha...@offhourstech.com>
Subject Re: New to couchdb, question about dynamic view?
Date Wed, 15 Apr 2009 17:31:15 GMT
Thank you very much...was really struggling to understand how to do that!

Jason

On Wed, Apr 15, 2009 at 1:24 PM, Paul Davis <paul.joseph.davis@gmail.com>wrote:

> 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
> <jtahaney@offhourstech.com> 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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message