【发布时间】:2022-01-17 10:32:24
【问题描述】:
class User {
constructor(doc) {
this.username = doc.username;
this.kills = doc.kills;
this.deaths = doc.deaths;
}
}
const res = await Calls.getAllUsers();
const users = res.map((doc) => new User(doc));
const sorted = users.sort((a, b) => b.kills - a.kills);
const whereIam =
sorted.indexOf(users.find((u) => u.username === latest_user)) + 1;
大家好,我正在整理玩家位置(击杀数)
他们会做 /stats 并且他们会根据最高击杀数获得一个位置 这需要超过 5 分钟才能确定玩家位置,每天制作 26,000 份文件和 2,000 份文件,有哪些步骤可以加快或改变?
【问题讨论】:
标签: node.js mongodb mongoose monk