I have the following rethinkdb data schema :
user_id -- generated by the application point -- given to the user on a successful completion of task
How can I select a single document AND its position amongst the other document in the collection, when sorted by score DESC. So if the collection data looks like this, when sorted by score:
user_id | score --------------- 10 | 100 01 | 90 ............... 22 | 01
I was able to find a solution to a similar problem (with MYSQL as the database.)
Here is the link:
MySQL get row position in ORDER BY
Currently i am loading the dataset at Node.js level, but is this possible at query level computation ?