From couchdb-dev-return-1231-apmail-incubator-couchdb-dev-archive=incubator.apache.org@incubator.apache.org Mon Nov 10 11:45:09 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-dev-archive@locus.apache.org Received: (qmail 40222 invoked from network); 10 Nov 2008 11:45:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Nov 2008 11:45:09 -0000 Received: (qmail 97960 invoked by uid 500); 10 Nov 2008 11:45:16 -0000 Delivered-To: apmail-incubator-couchdb-dev-archive@incubator.apache.org Received: (qmail 97920 invoked by uid 500); 10 Nov 2008 11:45:15 -0000 Mailing-List: contact couchdb-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-dev@incubator.apache.org Delivered-To: mailing list couchdb-dev@incubator.apache.org Received: (qmail 97909 invoked by uid 99); 10 Nov 2008 11:45:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 03:45:15 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tasman.main@gmail.com designates 64.233.182.185 as permitted sender) Received: from [64.233.182.185] (HELO nf-out-0910.google.com) (64.233.182.185) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Nov 2008 11:43:56 +0000 Received: by nf-out-0910.google.com with SMTP id c7so1306231nfi.40 for ; Mon, 10 Nov 2008 03:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version:in-reply-to :references:content-type:message-id:content-transfer-encoding:from :subject:date:to:x-mailer; bh=br/22b0fXT2cEPOCgb1lf0mHYZE4dfMBYj9NbwkAizM=; b=lsv82u7iCB0f2FSi9rOwY86PN04+6VTFTqWxwXmiLJGfkrpaJ/Ms8QeieV89E5tOvI KhRMXcTKFUaUj3Y8IEXU9YiUzV5TQKGfxyMNB/MZUYUT2kGN/muI1SefFAMQ029Zo4Qf kZnzqVlK6qGnM0FA8KrhbyvLk5Tx0X97glyo0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:content-type:message-id :content-transfer-encoding:from:subject:date:to:x-mailer; b=jRMjgtTm4bQpyRPkJNeYAdvSDx+bXjW1azhuPATF8OeXg1Wwcs6GbfDF9kadpqToJp c0fSPx2FRj9gdS9aMySRbjuBtbkX5PutJBE39UIQqnpcVKnWKejKaH16OOGvqURSQyAk 58xrXbf5f1aP0bRzlwYjC7FcG8YHmeapm/z50= Received: by 10.103.251.3 with SMTP id d3mr3638781mus.72.1226317477738; Mon, 10 Nov 2008 03:44:37 -0800 (PST) Received: from ?77.109.16.150? (77-109-16-150.dynamic.peoplenet.ua [77.109.16.150]) by mx.google.com with ESMTPS id w5sm30744886mue.10.2008.11.10.03.44.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Nov 2008 03:44:35 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2203851E-DBF3-4CBA-9CF7-0E2423AF9D4F@gmail.com> Content-Transfer-Encoding: 7bit From: tasman Subject: Re: User defined sort directions. Date: Mon, 10 Nov 2008 13:44:21 +0200 To: couchdb-dev@incubator.apache.org X-Mailer: Apple Mail (2.753.1) X-Virus-Checked: Checked by ClamAV on apache.org On Nov 9, 2008, at 11:54 PM, Paul Davis wrote: > Hey guys, > > Just created a ticket and added a patch for user definable view > sort directions. > > https://issues.apache.org/jira/browse/COUCHDB-158 > > Basically, this allows you to sort array keys based on the array > position. Its only ascending vs. descending. > > An example design document would be something like: > > { > "_id": "_design/foo", > "_rev": "872300123", > "views": { > "bar": { > "map": "function(doc) {emit([doc.val1, doc.val2], null);}", > "sort": [false, true] > } > } > } > > That'd sort descending on the doc.val1, and ascending on val2. > > When the sort array is shorter than the emitted view key, all values > are assumed to be true. > > Anyone have thoughts? May be it would be better to pass sort oder list into view request? > > Paul