I have a document collection of member
s which have two relevant properties: _key
and score
. I've also created a persistent
index on the score
field, as that should make sorting significantly faster. I want to write an AQL query that returns different results based on the sorted index of a specific member (referred to as A):
- Always returns at least the top 5 members by
score
. (LIMIT 5
) - If A is in the top 10, return the 6 - 10 ranked members. (
LIMIT 5, 5
) - Otherwise, return the members directly above and below A in rank. (
LIMIT x - 1, 3
, x = A's rank)