diff --git a/src/storage/datastore.ts b/src/storage/datastore.ts index 7ba0858..c74dbf5 100644 --- a/src/storage/datastore.ts +++ b/src/storage/datastore.ts @@ -214,6 +214,21 @@ const storage = { }); }, + async fetchCount( + collectionName: string, + filters?: Record + ): Promise { + return ( + await makeRequest<{ collectionName: string; count: number }>({ + url: "/app/data-storage/count", + body: { + collectionName, + filters: mapFilters(filters), + }, + }) + ).count; + }, + async fetchOne( collectionName: string, filters?: Record