Sort an array and add a rank field in MongoDB

前端 未结 0 2051
攒了一身酷
攒了一身酷 2021-02-08 03:30

Let\'s say I have a User collection which stores each user\'s score and name in MongoDB.

when listing all users, I want to add a new field to it to give me the ranking of

相关标签:
回答
  • 消灭零回复
提交回复
热议问题