ddstats-server/libs/utils/multithread/playerPoints.js

17 lines
403 B
JavaScript
Raw Normal View History

2021-10-16 19:11:16 +02:00
import Player from '../../../schemas/Player.js'
2021-10-16 19:58:00 +02:00
import { connectMongoose } from './mongoForWorkes.js'
2021-10-16 19:11:16 +02:00
2021-10-16 19:58:00 +02:00
connectMongoose()
2021-10-16 19:11:16 +02:00
export function main(data) {
return new Promise(
(resolve, reject) => {
Player.findOneAndUpdate(
{ name: data.name },
{ points: data.points }
).then(
() => resolve()
)
}
)
}