incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-886) Add option to set query options, defined in rewrites.json, as default
Date Mon, 13 Sep 2010 05:27:32 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908620#action_12908620
] 

Chris Anderson commented on COUCHDB-886:
----------------------------------------

I believe came to the conclusion that the feature would look like:

 { 
    "from" : "/general/reports", 
    "to" : "_list/general_reports/general_reportsByDate", 
    "query" : { 
      "descending" : true 
    } ,
    "default" : {
     "limit: 51
    }
  } 

where the "query" definition will continue to be mandatory, but the defaults will be overridable
by the client.

I'm not sure I like this... what if instead, the "query" parameter were to revert to the old
behavior (where the client can override it, and for the case where application designers want
to force a particular query, we could have "enforced-query". with that notion, the previous
example would look like this:

 { 
    "from" : "/general/reports", 
    "to" : "_list/general_reports/general_reportsByDate", 
    "query" : { 
       "limit: 51
    } ,
    "enforced-query" : {
      "descending" : true 
    }
  } 


The reason to have 2 members is to maintain backwards compatibility with existing rewrite
rules. I also think it is a bit clearer than the alternative.


> 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.


Mime
View raw message