couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject RE: Get all documents of a certain type.
Date Wed, 07 Nov 2012 02:46:35 GMT
Oups..  it's http://github.com/refuge/rcouch there are some details in the
refuge.io blog
On Nov 7, 2012 3:40 AM, "Kevin Burton" <rkevinburton@charter.net> wrote:

> This URL gives me a 404 error.
>
> -----Original Message-----
> From: Benoit Chesneau [mailto:bchesneau@gmail.com]
> Sent: Tuesday, November 06, 2012 8:27 PM
> To: user@couchdb.apache.org
> Subject: Re: Get all documents of a certain type.
>
> It's possible in rcouch (http://github.com/benoitc/rcouch) . I'm
> extracting
> patches from it this week so hopefully it will be in couchdb as well.
>
> On Wed, Nov 7, 2012 at 3:25 AM, Mark Hahn <mark@hahnca.com> wrote:
> > You can run the view, but it shows all docs in that view.  You can't
> > filter the results with keys.
> >
> > On Tue, Nov 6, 2012 at 6:22 PM, Kevin Burton
> <rkevinburton@charter.net>wrote:
> >
> >> What does it mean that Futon can't do keys? I cannot run this view in
> >> Futon?
> >>
> >> -----Original Message-----
> >> From: Mark Hahn [mailto:mark@hahnca.com]
> >> Sent: Tuesday, November 06, 2012 8:19 PM
> >> To: user@couchdb.apache.org
> >> Subject: Re: Get all documents of a certain type.
> >>
> >> I meant futon *can't* do keys
> >>
> >>
> >> On Tue, Nov 6, 2012 at 6:18 PM, Mark Hahn <mark@hahnca.com> wrote:
> >>
> >> > Futon can do keys
> >> >
> >> > On Tue, Nov 6, 2012 at 6:16 PM, Kevin Burton
> >> <rkevinburton@charter.net>wrote:
> >> >
> >> >> I am getting there. My mapper looks like:
> >> >>
> >> >>
> >> >>
> >> >> function(doc) {
> >> >>
> >> >>     if(doc._id.indexOf('product-') == 0 {
> >> >>
> >> >>         emit([doc.SKU], null);
> >> >>
> >> >>     }
> >> >>
> >> >> }
> >> >>
> >> >>
> >> >>
> >> >> With a key of 'by-sku'. How do I run this in Futon? In his case
> >> >> does doc.type do the same thing as indexOf?
> >> >>
> >> >>
> >> >>
> >> >> -----Original Message-----
> >> >> From: Dustin Sallings [mailto:dustin@spy.net]
> >> >> Sent: Tuesday, November 06, 2012 7:03 PM
> >> >> To: user@couchdb.apache.org
> >> >> Subject: Re: Get all documents of a certain type.
> >> >>
> >> >>
> >> >>
> >> >> "Kevin Burton" < <mailto:rkevinburton@charter.net>
> >> >> rkevinburton@charter.net>
> >> >>
> >> >> writes:
> >> >>
> >> >>
> >> >>
> >> >> > I thought the "or" you were referring to was the "or" that I
> >> >> > said were
> >> >>
> >> >> > the types of documents "product-xxx" or "order-xxx".
> >> >>
> >> >> >
> >> >>
> >> >> > If I have a view what would be the request and what would the
> >> >> > view
> >> >>
> >> >> > look like? If I didn't have a view what would the query look like?
> >> >> > So
> >> >>
> >> >> > two questions.
> >> >>
> >> >>
> >> >>
> >> >>   The second was answered earlier.  It's the _all_docs query.
> >> >>
> >> >>
> >> >>
> >> >>   The first would be a little be easier to answer if you could
> >> >> provide an example document, but you'll have a mapper that looked
> >> >> something like
> >> >>
> >> >> this:
> >> >>
> >> >>
> >> >>
> >> >>       function(doc) {
> >> >>
> >> >>         if (doc.type === 'product') {
> >> >>
> >> >>             emit(doc.sku, null);
> >> >>
> >> >>         }
> >> >>
> >> >>       }
> >> >>
> >> >>
> >> >>
> >> >>   You would then save that as a design document and query query it.
> >> >> If you do this from futon, you can experiment interactively, and
> >> >> the click on the little raw result tab thing in the top to get the
> >> >> URL you'd use from your application.
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >>
> >> >> dustin
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >>
> >>
>
>

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