Return-Path: Delivered-To: apmail-incubator-couchdb-dev-archive@locus.apache.org Received: (qmail 84337 invoked from network); 28 Sep 2008 18:36:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Sep 2008 18:36:35 -0000 Received: (qmail 22153 invoked by uid 500); 28 Sep 2008 18:36:33 -0000 Delivered-To: apmail-incubator-couchdb-dev-archive@incubator.apache.org Received: (qmail 21929 invoked by uid 500); 28 Sep 2008 18:36:33 -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 21918 invoked by uid 99); 28 Sep 2008 18:36:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2008 11:36:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2008 18:35:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3F6F9234C1E1 for ; Sun, 28 Sep 2008 11:35:44 -0700 (PDT) Message-ID: <1402684224.1222626944245.JavaMail.jira@brutus> Date: Sun, 28 Sep 2008 11:35:44 -0700 (PDT) From: "Chris Anderson (JIRA)" To: couchdb-dev@incubator.apache.org Subject: [jira] Commented: (COUCHDB-124) Adding first and last sort keys In-Reply-To: <1286492837.1222198184450.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635245#action_12635245 ] Chris Anderson commented on COUCHDB-124: ---------------------------------------- We discussed this on IRC - there's not a good reason to add this. See http://wiki.apache.org/couchdb/ViewCollation for full documentation of the JSON sort order. In the case of the example given, there is no need for the 'ZZZZ' string, this is equivalent and not hackish. startkey=["tag_name"]&endkey=["tag_name", {}] of course, this doesn't help with the case of startkey="_design/"&endkey="_design/ZZZZZZZZZ" which we see frequently. But there's no way a "special" value can help with a string range, because we can't allow the special value *inside* the string without opening a whole can of worms. If you didn't want to be hackish while defining a string range you could use a super-high unicode character. startkey="_design/"&endkey="_design/\u9999" > Adding first and last sort keys > ------------------------------- > > Key: COUCHDB-124 > URL: https://issues.apache.org/jira/browse/COUCHDB-124 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface > Reporter: Paul Joseph Davis > > We should add values to the view query that are guranteed to be sorted first or last. > Simple example, given an emitted key of something like [doc.tag, doc.descr] currently to get the data for a specific tag we would use something like: > startkey=['tag_name']&endkey=['tag_name', 'ZZZZZZ'] which is a bit hackish at best. > Perhaps startkey=['tag_name',_first_]&endkey=['tag_name',_last_] > Obviously _first_ and _last_ are crappy. And _first_ would even be optional. But hopefully that conveys the idea. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.