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 D84F9D868 for ; Wed, 7 Nov 2012 02:19:31 +0000 (UTC) Received: (qmail 19232 invoked by uid 500); 7 Nov 2012 02:19:30 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19199 invoked by uid 500); 7 Nov 2012 02:19:30 -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 19191 invoked by uid 99); 7 Nov 2012 02:19:30 -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:19:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.212.182] (HELO mail-wi0-f182.google.com) (209.85.212.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 02:19:22 +0000 Received: by mail-wi0-f182.google.com with SMTP id hm9so205219wib.5 for ; Tue, 06 Nov 2012 18:19:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:content-type:x-gm-message-state; bh=CrtUmmnksup6b0OPp9vEO4P6VzMXq/BxKu0YVlLYOcY=; b=WIDw7LAiPTEfAXvjz+3ygZ5lOYc+60SKitdbJ292oBlednKYqv4f9yITEtQA8S8PMi WVGPYuqDpOrYH5P8+jUWWKPgCFNYOlSyTL0z+Lt7epeThg3LMr/l/TkkxhPBkYGErwos 2zuJKLzAcXnCIw00HVXLiXtJgxh2Wq2IjwcFkDqHjnA4341ugXhjqgkUGRZMm66PDos8 SZmoMEKLtAx9sVAct8LxoQHGTnow7Y5ynjK437EOAKtIybeXmlrPZblpvBtsGbZGL9G1 I/fo5jOSb3/uaHvPnjt+1fW82soIBu953wqUNT6dM/nL8/nlTyB5VcQRpy1qTvCvgAzQ 6mAA== Received: by 10.180.78.161 with SMTP id c1mr5171268wix.4.1352254740643; Tue, 06 Nov 2012 18:19:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.103.65 with HTTP; Tue, 6 Nov 2012 18:18:40 -0800 (PST) X-Originating-IP: [68.5.117.177] In-Reply-To: <02e801cdbc8d$f2371840$d6a548c0$@charter.net> References: <028101cdbc69$cac8d600$605a8200$@charter.net> <029201cdbc6f$292980f0$7b7c82d0$@charter.net> <02bc01cdbc7c$2bf18eb0$83d4ac10$@charter.net> <02e801cdbc8d$f2371840$d6a548c0$@charter.net> From: Mark Hahn Date: Tue, 6 Nov 2012 18:18:40 -0800 Message-ID: Subject: Re: Get all documents of a certain type. To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d0435c032763fcb04cdde57d7 X-Gm-Message-State: ALoCoQlqTNs6pp7OJ+TpqwzHI50iiHHstOX/RiqXCC/jbR0tbSRRBlwVDcHIC4Y3HOnw5GcYZhWP X-Virus-Checked: Checked by ClamAV on apache.org --f46d0435c032763fcb04cdde57d7 Content-Type: text/plain; charset=ISO-8859-1 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 > > > > --f46d0435c032763fcb04cdde57d7--