From user-return-22797-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Nov 7 03:00:24 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 CE616D99F for ; Wed, 7 Nov 2012 03:00:24 +0000 (UTC) Received: (qmail 7930 invoked by uid 500); 7 Nov 2012 03:00:23 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 7894 invoked by uid 500); 7 Nov 2012 03:00:22 -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 7876 invoked by uid 99); 7 Nov 2012 03:00:22 -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:00:22 +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 [74.125.82.180] (HELO mail-we0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2012 03:00:15 +0000 Received: by mail-we0-f180.google.com with SMTP id t57so491816wey.11 for ; Tue, 06 Nov 2012 18:59:54 -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=sgS/+ttjLO26F9I3PWa7hMUDNmiTeTJxtzxUuLas3a4=; b=DHFG8HFpHAWhizOVbVwXfKlQuPI6gm5tFKS2dyY20oPcDlqJABuvmQAim1NxNpPnQa 7BYQ5Af+vBa7BvmSuhm7TEMXD40p79FfFU2DUZDaD3/JNADKGjSCWbDG/6SiN7Tjw+fF adHUGT8mDrR0fAYVzNUxXI7fYdoIGUWfQWyqqo77EBLUpqWCsiP+q6MM/wVbHO+46fu4 CnPukPI2enqXT5q1iKTEZ1mws7q+64c0SfZsIDc2WY1COACa9AAwTGepCpgwWKM8FTZN G18VSVFskN5NGFWva25Yj95ZL2ZX4INR+ve+RIDJ05pgoxQ/5FSjFhuLwDBR7Qmuxeqm M7Gg== Received: by 10.180.104.97 with SMTP id gd1mr5266172wib.4.1352257194751; Tue, 06 Nov 2012 18:59:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.103.65 with HTTP; Tue, 6 Nov 2012 18:59:34 -0800 (PST) X-Originating-IP: [68.5.117.177] In-Reply-To: <02fd01cdbc90$f7d69480$e783bd80$@charter.net> 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> From: Mark Hahn Date: Tue, 6 Nov 2012 18:59:34 -0800 Message-ID: Subject: Re: Get all documents of a certain type. To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d044280e6bcf69204cddee954 X-Gm-Message-State: ALoCoQmQtfNQA6wpEb4V/3tuAl/TYjJNyLq8zqnHMXWMjkmvQJ1n/4EhmZuMtvthMupVxAufqkQ7 X-Virus-Checked: Checked by ClamAV on apache.org --f46d044280e6bcf69204cddee954 Content-Type: text/plain; charset=ISO-8859-1 > 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 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 > 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 > > >> > > >> > > >> > > >> > > > > > > > > > --f46d044280e6bcf69204cddee954--