大家好,我想从 mongoDB 获取结果,这样当我在排行榜中搜索任何用户时,它都会给我相同的用户等级(如果搜索后它处于 rank2,它应该保持相同的等级)。这是我的查询:
db
.collection('users')
.find({
points: { $gt: 0 }
})
.sort({ points: -1 })
.select("_id fullName username countryFlag countryName avatar points wonChallenges following wonCompetitions wonCompetitionMatches")