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 4CC0ED95C for ; Wed, 7 Nov 2012 02:40:05 +0000 (UTC) Received: (qmail 61935 invoked by uid 500); 7 Nov 2012 02:40:04 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 61714 invoked by uid 500); 7 Nov 2012 02:40:03 -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 61702 invoked by uid 99); 7 Nov 2012 02:40:03 -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 02:40:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=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 02:39:57 +0000 Received: from imp11 ([10.20.200.11]) by mta21.charter.net (InterMail vM.8.01.05.02 201-2260-151-103-20110920) with ESMTP id <20121107023936.MNDC12025.mta21.charter.net@imp11> for ; Tue, 6 Nov 2012 21:39:36 -0500 Received: from KevinPC ([24.159.241.210]) by imp11 with smtp.charter.net id LSfc1k00A4Z4VX405Sfc1h; Tue, 06 Nov 2012 21:39:36 -0500 X-Authority-Analysis: v=1.1 cv=Mv9Cy8NsQItTEAHnXr6fCNbI23lcrkmyMeqLv9HU3yU= c=1 sm=1 a=yAtnTw06aZAA:10 a=yUnIBFQkZM0A:10 a=kj9zAlcOel0A:10 a=rvDZ1Ou6zk5jcJFOa7NSqA==:17 a=pGLkceISAAAA:8 a=mV9VRH-2AAAA:8 a=NEAV23lmAAAA:8 a=oOolCUK7AAAA:8 a=hOpmn2quAAAA:8 a=3aRkHq24AAAA:8 a=9mEzPZ0AwZW-Pt9M5KsA:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=KgA0Cw3b7jkA:10 a=hUswqBWy9Q8A:10 a=zj1hMhbgzY4A:10 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> In-Reply-To: Subject: RE: Get all documents of a certain type. Date: Tue, 6 Nov 2012 20:39:36 -0600 Message-ID: <02fe01cdbc91$20dd8280$62988780$@charter.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHC5527NUkEacb3YaETM95tSJ8evgJvc/AiAlN4JrABQLcTywE6biB7AnnhEQQB0E2NBwFHBpcVAi+Z6hsBalggCgK4XXydAfiGQOGXSoINgA== Content-Language: en-us X-Virus-Checked: Checked by ClamAV on apache.org 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 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 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 wrote: >> >> > Futon can do keys >> > >> > On Tue, Nov 6, 2012 at 6:16 PM, Kevin Burton >> 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" < >> >> 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 >> >> >> >> >> >> >> >> >> > >> >>