From dev-return-11703-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Mon Sep 13 11:06:08 2010 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 35695 invoked from network); 13 Sep 2010 11:06:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 11:06:07 -0000 Received: (qmail 79001 invoked by uid 500); 13 Sep 2010 11:06:07 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 78510 invoked by uid 500); 13 Sep 2010 11:06:03 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 78391 invoked by uid 99); 13 Sep 2010 11:06:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 11:06:02 +0000 X-ASF-Spam-Status: No, hits=-1997.7 required=10.0 tests=ALL_TRUSTED,URI_NO_WWW_INFO_CGI X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 11:05:59 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8DB5d6A026529 for ; Mon, 13 Sep 2010 11:05:39 GMT Message-ID: <18720274.151531284375939391.JavaMail.jira@thor> Date: Mon, 13 Sep 2010 07:05:39 -0400 (EDT) From: "Benoit Chesneau (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-886) Add option to set query options, defined in rewrites.json, as default In-Reply-To: <183235.146831284354191622.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908721#action_12908721 ] Benoit Chesneau commented on COUCHDB-886: ----------------------------------------- the problem with all of this is to allows the users to override query parameters. Ex if I have this rule: { "from": "/city/paris", "to": "_list/test", "query": { "startkey": "paris", 'endkey": ":paris\0" } If we make query overridable, that mean that someone passing starkey=&endkey= will override the path rule. Here we are in a simple case so it doesn't really matter, but it could be worth. If we have default on the other hand, for example with a limit parameter : { "from": "/city/paris", "to": "_list/test", "query": { "startkey": "paris", "endkey": ":paris\0", "limit": ":llimit" }, "default": { "limit": 10 } } Then if we do /city/paris, the default limit will be use while if we do /city/paris?limit=50, limit query parameter will be used. Imo, "default": {} is really the tight way to handle such problem. > Add option to set query options, defined in rewrites.json, as default > --------------------------------------------------------------------- > > Key: COUCHDB-886 > URL: https://issues.apache.org/jira/browse/COUCHDB-886 > Project: CouchDB > Issue Type: Bug > Components: Database Core > Reporter: Henrik Skupin > > With the latest version of CouchDB the URL parameters are not taken into account when the rewrites.json file specifies the same ones for the appropriate entry. See the following example: > { > "from" : "/general/reports", > "to" : "_list/general_reports/general_reportsByDate", > "query" : { > "descending" : true, > "limit" : 51 > } > } > default values: http://mozmill.hskupin.info/general/reports > custom values: http://mozmill.hskupin.info/general/reports?limit=10 > Whether which URL you are loading, the values from rewrites.json are always used. Once the limit entry gets removed from that file, the URL parameter is used and 10 rows are displayed. > As proposed by Benoit query entries should be explicitly allowed to have a default value. Otherwise the value from rewrites.json has the priority. > "query": { > "key": { "value": ":var", "default": 1} > } > Can true be used instead of a number? It could be confusing this way, especially when the value is also a number. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.