From user-return-22799-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Nov 7 03:12:04 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24D8EDA53 for ; Wed, 7 Nov 2012 03:12:04 +0000 (UTC) Received: (qmail 34985 invoked by uid 500); 7 Nov 2012 03:12:02 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 34858 invoked by uid 500); 7 Nov 2012 03:12:01 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 34820 invoked by uid 99); 7 Nov 2012 03:12:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 03:12:00 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_IMAGE_RATIO_06,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rkevinburton@charter.net designates 216.33.127.81 as permitted sender) Received: from [216.33.127.81] (HELO mta21.charter.net) (216.33.127.81) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 03:11:53 +0000 Received: from imp09 ([10.20.200.9]) by mta21.charter.net (InterMail vM.8.01.05.02 201-2260-151-103-20110920) with ESMTP id <20121107031132.MYFE12025.mta21.charter.net@imp09> for ; Tue, 6 Nov 2012 22:11:32 -0500 Received: from KevinPC ([24.159.241.210]) by imp09 with smtp.charter.net id LTBX1k00U4Z4VX405TBXDe; Tue, 06 Nov 2012 22:11:32 -0500 X-Authority-Analysis: v=1.1 cv=nlrKf9u5uG3fs/vD0VBbL3/xzyN25p4t1WHsSeqasGo= c=1 sm=1 a=yAtnTw06aZAA:10 a=yUnIBFQkZM0A:10 a=rvDZ1Ou6zk5jcJFOa7NSqA==:17 a=oOolCUK7AAAA:8 a=mV9VRH-2AAAA:8 a=hOpmn2quAAAA:8 a=3aRkHq24AAAA:8 a=1arqLzNPsOW1VpNte3MA:9 a=CjuIK1q_8ugA:10 a=KgA0Cw3b7jkA:10 a=hUswqBWy9Q8A:10 a=zj1hMhbgzY4A:10 a=yMhMjlubAAAA:8 a=SSmOFEACAAAA:8 a=ydDMK0sXyRtFTYoVTgIA:9 a=gKO2Hq4RSVkA:10 a=UiCQ7L4-1S4A:10 a=hTZeC7Yk6K0A:10 a=frz4AuCg-hUA:10 a=KkhYV1QxIKqloRmi:21 a=_5pMAeHjJu3WYcQXvqUA:9 a=HXjIzolwW10A:10 a=WfWwwfQV1VHAExlT:21 a=lOcoI_xQ49yiOQun:18 a=rvDZ1Ou6zk5jcJFOa7NSqA==:117 From: "Kevin Burton" To: References: <028101cdbc69$cac8d600$605a8200$@charter.net> <029201cdbc6f$292980f0$7b7c82d0$@charter.net> <02bc01cdbc7c$2bf18eb0$83d4ac10$@charter.net> <02e801cdbc8d$f2371840$d6a548c0$@charter.net> <02f601cdbc8e$b0bce600$1236b200$@charter.net> <02fd01cdbc90$f7d69480$e783bd80$@charter.net> In-Reply-To: Subject: RE: Get all documents of a certain type. Date: Tue, 6 Nov 2012 21:11:32 -0600 Message-ID: <031101cdbc95$967a9f60$c36fde20$@charter.net> MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_0312_01CDBC63.4BE9A540" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHC5527NUkEacb3YaETM95tSJ8evgJvc/AiAlN4JrABQLcTywE6biB7AnnhEQQB0E2NBwFHBpcVAi+Z6hsBalggCgK4XXydAcLMty4B/4idU5c8PAiw Content-Language: en-us X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_0312_01CDBC63.4BE9A540 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0313_01CDBC63.4BE9A540" ------=_NextPart_001_0313_01CDBC63.4BE9A540 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I don't see this drop-down. -----Original Message----- From: Mark Hahn [mailto:mark@hahnca.com] Sent: Tuesday, November 06, 2012 9:00 PM To: user@couchdb.apache.org Subject: Re: Get all documents of a certain type. > So how do I run the view? Choose it from the drop-down list of views. On Tue, Nov 6, 2012 at 6:38 PM, Kevin Burton < rkevinburton@charter.net>wrote: > > So how do I run the view? The purpose of this view is to get a list of > SKUs for all documents so I don't need to filter. > > -----Original Message----- > From: Mark Hahn [ mailto:mark@hahnca.com] > Sent: Tuesday, November 06, 2012 8:25 PM > To: user@couchdb.apache.org > Subject: Re: Get all documents of a certain type. > > 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 > > >> > > >> > > >> > > >> > > > > > > > > > ------=_NextPart_001_0313_01CDBC63.4BE9A540 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I don't = see this drop-down.

 

 

-----Original Message-----
From: Mark Hahn = [mailto:mark@hahnca.com]
Sent: Tuesday, November 06, 2012 9:00 = PM
To: user@couchdb.apache.org
Subject: Re: Get all documents of a = certain type.

 

> So how do I run the view?

 

Choose = it from the drop-down list of views.

 

 

On = Tue, Nov 6, 2012 at 6:38 PM, Kevin Burton <rkevinburton@charter.net<= /span>>wrote:

 

> 

> So how do I run the view? The purpose of this = view is to get a list of

> = SKUs for all documents so I don't need to filter.

> 

> -----Original Message-----

> From: Mark Hahn [mailto:mark@hahnca.com]

> Sent: Tuesday, = November 06, 2012 8:25 PM

> To: = user@couchdb.apache.org

> Subject: Re: Get = all documents of a certain type.

> 

> 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<= /span>>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<= /span>>wrote:

> > = >

> > >> I am = getting there. My mapper looks like:

> > >>

> > >>

> > >>

> > >> function(doc) {

> > >>

> > >>     = if(doc._id.indexOf('product-') =3D=3D 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@chart= er.net>

> > = >> rkevinburton@charter.net<= /span>>

> > = >>

> > >> = 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 = =3D=3D=3D '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

> > = >>

> > = >>

> > = >>

> > = >>

> > = >

> >

> >

> 

> 

------=_NextPart_001_0313_01CDBC63.4BE9A540-- ------=_NextPart_000_0312_01CDBC63.4BE9A540--