Aboud
Aboud9h ago

batchCount doesn't seem to exist in aggregate?

I'm using
"@convex-dev/aggregate": "^0.1.24"
"@convex-dev/aggregate": "^0.1.24"
. When I query an aggregate...
const counts = await userAggContact.batchCount(ctx, {
queries: [
{ namespace: user_id },
{ namespace: user_id, bounds: { prefix: ['active'] } },
],
})
const counts = await userAggContact.batchCount(ctx, {
queries: [
{ namespace: user_id },
{ namespace: user_id, bounds: { prefix: ['active'] } },
],
})
, ...I get a Typescript error...
Property 'batchCount' does not exist on type 'TableAggregate<{ Namespace: string; Key: [string, number, number, string]; DataModel: { organizations: { document: { _id: Id<"organizations">; _creationTime: number; color?: string | undefined; auth_id?: string | undefined; ... 20 more ...; allocated_seats: number; }; fieldPaths: ExtractFieldPaths<...> | "_id"; inde...'.
Property 'batchCount' does not exist on type 'TableAggregate<{ Namespace: string; Key: [string, number, number, string]; DataModel: { organizations: { document: { _id: Id<"organizations">; _creationTime: number; color?: string | undefined; auth_id?: string | undefined; ... 20 more ...; allocated_seats: number; }; fieldPaths: ExtractFieldPaths<...> | "_id"; inde...'.
I'm able to query normally (e.g., count, sum), but it seems batchCount doesn't work? Anyone else encounter this?
2 Replies
Convex Bot
Convex Bot9h ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!

Did you find this page helpful?