MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / getLastResultTimestamp

Function getLastResultTimestamp

backend/src/dal/result.ts:81–92  ·  view source on GitHub ↗
(uid: string)

Source from the content-addressed store, hash-verified

79}
80
81export async function getLastResultTimestamp(uid: string): Promise<number> {
82 const lastResult = await getResultCollection().findOne(
83 { uid },
84 {
85 projection: { timestamp: 1, _id: 0 },
86 sort: { timestamp: -1 },
87 },
88 );
89
90 if (lastResult === null) throw new MonkeyError(404, "No last result found");
91 return lastResult.timestamp;
92}
93
94export async function getResultByTimestamp(
95 uid: string,

Callers

nothing calls this directly

Calls 1

getResultCollectionFunction · 0.85

Tested by

no test coverage detected