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 6F3A1D869 for ; Wed, 7 Nov 2012 02:19:48 +0000 (UTC) Received: (qmail 21147 invoked by uid 500); 7 Nov 2012 02:19:47 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 21113 invoked by uid 500); 7 Nov 2012 02:19:47 -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 21105 invoked by uid 99); 7 Nov 2012 02:19:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 02:19:47 +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 (nike.apache.org: local policy) Received: from [74.125.82.54] (HELO mail-wg0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 02:19:38 +0000 Received: by mail-wg0-f54.google.com with SMTP id dt10so624680wgb.23 for ; Tue, 06 Nov 2012 18:19:18 -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=EyA89oWxjwpzTFKoLQ6sh0RnZ/J45Ph4PhT2jdWBiPQ=; b=FaLGp5XWG9mSNmQv/ddfdZ4tIJIA8p2wn4JfH4tL9YNuUbdBOs7SMN47gkmcqrLMu9 lZH8Dh3aTJ3bvoB/ki3z+HknCuuNf8zNxexx/ajwDuHTCo+sCKuQI9nlsKw70jbPNabL gl3E0esR83YHOzBwNVwKrBRzDlxh8yej38cvAtd1EqxpB1xwTquLVxPr5Am80KvJpxPs Kvaf6PADfs8xmX/1hIOl3GCSblNFxGTndV0pZKgZJlqFhzuMwE0+wxDX31j4yzUZ99xg Ozs3lnwKGXFioUj2kWmkyiJRKzX+ejZI4rrTb4DmyWEBayMxhTsBgjiwsGCPN9M9pUgc ahdw== Received: by 10.181.11.197 with SMTP id ek5mr22200672wid.4.1352254758471; Tue, 06 Nov 2012 18:19:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.103.65 with HTTP; Tue, 6 Nov 2012 18:18:58 -0800 (PST) X-Originating-IP: [68.5.117.177] In-Reply-To: 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:58 -0800 Message-ID: Subject: Re: Get all documents of a certain type. To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d04388e5b8647aa04cdde5852 X-Gm-Message-State: ALoCoQmcSh8MfUaLsr5RkCIdDl8vi4dXJuyBdPuNYCMWbXPmASKGBGxmJ/ODBsFg8U9/UHl/Lxrq X-Virus-Checked: Checked by ClamAV on apache.org --f46d04388e5b8647aa04cdde5852 Content-Type: text/plain; charset=ISO-8859-1 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 >> >> >> >> > --f46d04388e5b8647aa04cdde5852--