You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Thaina Yu (JIRA)" <ji...@apache.org> on 2016/07/28 03:26:20 UTC

[jira] [Created] (COUCHDB-3085) Negative skip query

Thaina Yu created COUCHDB-3085:
----------------------------------

             Summary: Negative skip query
                 Key: COUCHDB-3085
                 URL: https://issues.apache.org/jira/browse/COUCHDB-3085
             Project: CouchDB
          Issue Type: Improvement
          Components: Database Core
            Reporter: Thaina Yu


This is an idea for leaderboard system but it may useful for other purpose

Normally leaderboard would like to query around target number. For example, score of one player. Then we would get a list around that row, 5 above and 5 below

By couchdb we need to query 2 times, one for above and one for below

But I think if couchdb could accept negative skip we could do it by one query

With 2 query we could use
- ?startKey=score&limit=6
- ?startKey=(score-0.001)&limit=5&descending=true

With negative skip
- ?startKey=score&skip=-5&limit=11



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)