feat: rival-info table

This commit is contained in:
zkldi
2022-12-18 23:53:16 +00:00
parent a88903d28d
commit c4e8a88aad
4 changed files with 180 additions and 42 deletions
+45
View File
@@ -0,0 +1,45 @@
import db from "external/mongo/db";
import type { Game, Playtype, integer } from "tachi-common";
export async function GetRecentUGPTScores(
userID: integer,
game: Game,
playtype: Playtype,
limit = 100
) {
return db.scores.find(
{
userID,
game,
playtype,
},
{
sort: {
timeAdded: -1,
},
limit,
}
);
}
export async function GetRecentUGPTHighlights(
userID: integer,
game: Game,
playtype: Playtype,
limit = 100
) {
return db.scores.find(
{
userID,
game,
playtype,
highlight: true,
},
{
sort: {
timeAdded: -1,
},
limit,
}
);
}