Upgrade NSpec, update count interface

This commit is contained in:
Alex Gleason
2024-02-12 10:48:26 -06:00
parent 676bd04229
commit cb80770fc7
10 changed files with 25 additions and 51 deletions

View File

@@ -96,7 +96,7 @@ function connectStream(socket: WebSocket) {
/** Handle COUNT. Return the number of events matching the filters. */
async function handleCount([_, subId, ...rest]: ClientCOUNT): Promise<void> {
const count = await eventsDB.count(prepareFilters(rest));
const { count } = await eventsDB.count(prepareFilters(rest));
send(['COUNT', subId, { count, approximate: false }]);
}