我有以下rethinkdb数据模式:
user_id -- generated by the application
point -- given to the user on a successful completion of task
当按分数DESC排序时,如何选择单个文档及其在集合中其他文档中的位置 . 因此,如果集合数据看起来像这样,则按分数排序:
user_id | score
---------------
10 | 100
01 | 90
...............
22 | 01
我能够找到类似问题的解决方案(使用MYSQL作为数据库 . )这是链接:
MySQL get row position in ORDER BY
目前我正在Node.js级别加载数据集,但这在查询级别计算时是否可行?