Comments on: Creating Multi-Game Highscore Lists: ArangoDB Techniques https://arangodb.com/2015/04/creating-multi-game-highscore-lists/ The database for graph and beyond Thu, 27 Jun 2024 07:37:46 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: jsteemann https://arangodb.com/2015/04/creating-multi-game-highscore-lists/#comment-595 Thu, 23 Apr 2015 22:42:00 +0000 http://www.arangodb.com/?p=7404#comment-595 In reply to Matthew York.

There is no direct equivalent to ZRANK or ZREVRANK in ArangoDB. This is because the documents in the highscores collection do not have any particular order. They will come out sorted by score only when explicitly querying them with a sort statement in a query. The sort instruction will sort them according to the given criteria or will use an existing index to iterate over the documents in sorted order if there is an index that covers the sort criteria. But even if an index is present, it won’t contain a documents position/rank inside the index or the collection, so there’s no place where to look up an up-to-date rank efficiently.

]]>
By: pyros2097 https://arangodb.com/2015/04/creating-multi-game-highscore-lists/#comment-594 Wed, 22 Apr 2015 05:03:00 +0000 http://www.arangodb.com/?p=7404#comment-594 In reply to Matthew York.

You wont need to count the records everytime … You can actually calculate the ranks yourself.. When you sort by descending the first document will always be the first rank and the other following documents you just have to increment the rank it…. And if you are using range queries then you will have a skip and limit using these you can easily calculate the ranks of all your players..

]]>
By: Matthew York https://arangodb.com/2015/04/creating-multi-game-highscore-lists/#comment-593 Tue, 21 Apr 2015 15:50:00 +0000 http://www.arangodb.com/?p=7404#comment-593 Thanks for this article.

One of the redis features I’ve used alot is http://redis.io/commands/zrank

Players tend to want to know overall rank (1st, 2nd… etc ) more often than score.

Does arrango have something similar? or would I be forced to count the records every time?

]]>