Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 73984 invoked from network); 27 Oct 2009 16:42:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 16:42:58 -0000 Received: (qmail 93800 invoked by uid 500); 27 Oct 2009 16:42:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 93730 invoked by uid 500); 27 Oct 2009 16:42:57 -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 93720 invoked by uid 99); 27 Oct 2009 16:42:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 16:42:57 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of awolff@gmail.com designates 209.85.160.56 as permitted sender) Received: from [209.85.160.56] (HELO mail-pw0-f56.google.com) (209.85.160.56) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 16:42:54 +0000 Received: by pwi18 with SMTP id 18so208185pwi.35 for ; Tue, 27 Oct 2009 09:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=aXqp9excA8yzQK5TSpUiXrKxM0/8Hc1rL7juBtfFhOI=; b=chAxrHfNCo5KDLqHaEITRz0Sl/0yKqWMqgxnSpF+ldqbzjq/TMRNQdBS2AlYT8qGZb HkBe08wtKiLxGjOgkefNEANfdhX32rpSvtYht26kYj7/ilG/46NUcVnyzpCTR9eUyGsC RQDGKlgDwW2XJEDYP9Lxz6XElxYS94oxCGPk8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=T8qa/ZAvPROFz6L9GEoMkzKP8M2TLUGy8RLT/grkGyOQHyEjLVJpjHTejQKYbNy1DY ruxzt/3uBInMhNf1wjEuTA6jMhJwegr8WndHk0KhBvBl59wJ4dRP0532Tg78mKzyVGyF jfPTmrugUAa5qX3iwk4N3gddQEwqAHoORaf/g= MIME-Version: 1.0 Received: by 10.140.194.19 with SMTP id r19mr2116071rvf.281.1256661754315; Tue, 27 Oct 2009 09:42:34 -0700 (PDT) In-Reply-To: References: <8098243e0910270750n52f9a2dcma2d1592daaa9986f@mail.gmail.com> <03E7FF46-E9A4-4AF7-8CEE-7283F23E0EB3@apache.org> Date: Tue, 27 Oct 2009 09:42:34 -0700 Message-ID: Subject: Re: multiple range queries via POST? From: Adam Wolff To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd14bec7805ed0476ed5d13 --000e0cd14bec7805ed0476ed5d13 Content-Type: text/plain; charset=ISO-8859-1 makes sense. should that be "ranges"? A On Tue, Oct 27, 2009 at 8:49 AM, Paul Davis wrote: > I'd rather see something like: > > {keys: [k1, k2, k3]} > > or > > {range: [query_params_1, query_params_2]} > > with > > query_params_1 = {startkey: k1, endkey: k2} etc etc > > With ranges and keys being mutually exclusive > > Paul Davis > > On Tue, Oct 27, 2009 at 11:37 AM, Adam Wolff wrote: > > We could really use this feature too. Right now, we do this: > > > > post("/path_to_view/", {keys : keys}); > > > > For this feature, maybe the syntax could be > > > > post("/path_to_view/", {keys : [{start:[k1, null], end:[k1, {}]}, > > {start:[k2, null], end:[k2, {}]} }); > > > > A > > > > > > On Tue, Oct 27, 2009 at 7:55 AM, Adam Kocoloski > wrote: > > > >> On Oct 27, 2009, at 10:50 AM, Alex P wrote: > >> > >> i know this is currently unsupported (and may be more of a question for > >>> the > >>> dev list), but is there a technical reason while multi-range queries > can't > >>> be submitted to couch (slight ah-hah moment at the end)? > >>> > >>> the specific problem i'm trying to address is this: > >>> > >>> suppose i have a message document, and a corresponding map function: > >>> > >>> function (doc) { > >>> if (doc.docType != 'message') return; > >>> > >>> emit(doc.owner, null); > >>> } > >>> > >>> if i wanted to pull back all messages for users foo and bar, i'd simply > do > >>> a > >>> POST path/to/couch keys = ['foo', 'bar']. now let's make this data come > >>> back > >>> sorted by create date: > >>> > >>> function (doc) { > >>> if (doc.docType != 'message') return; > >>> > >>> emit([doc.owner, doc.createDate], null); > >>> } > >>> > >>> also cool, but now, to retrieve all messages pertaining to a single > user, > >>> i > >>> need to do GET path/to/couch startKey=['foo']&endKey=['foo', 'a']. this > >>> works, but it now means that if i want all messages pertaining to both > foo > >>> and bar, i need to run two separate queries. > >>> > >>> as i'm writing this, i think i'm starting to see that the problem would > be > >>> with having to merge overlapping ranges, but i still would like someone > >>> else > >>> to weigh in on this > >>> > >>> > >>> thanks, > >>> alex. > >>> > >> > >> Hi Alex, internally, multiple keys are actually just a special case of > >> multiple ranges. So that part is easy. We would want to be clear about > how > >> we handle overlapping ranges, but it's not that hard of a problem > really. > >> > >> I wonder what the HTTP call for this should look like? > >> > >> Adam > >> > >> > > > --000e0cd14bec7805ed0476ed5d13--