Aboud
Aboud•2mo 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?
11 Replies
Convex Bot
Convex Bot•2mo 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!
Anthony Brooks
Anthony Brooks•2mo ago
Can this please be updated in the documentation? Because it still shows batchCount and aside from the README in the github aggregate directory and your comment here, nothing leads to that update (from August). Your own AI just gaslights users by suggesting that the aggregate component that they're using is outdated
Sara
Sara•2mo ago
I'm sorry what? My own AI?
Anthony Brooks
Anthony Brooks•2mo ago
Convex' AI. I felt since you're a moderator, that was clear? I didn't mean yours personally Odd that's what was latched onto there.
Sara
Sara•2mo ago
Like you said, I'm a mod, not a convex team member
Anthony Brooks
Anthony Brooks•2mo ago
Okay, can someone from the team please update this, then? You're who responded representing Convex, so I generalized who I was replying to as you (Convex) This is in the support community forum and you're the only one who had replied, so I was just directing that to you.
Sara
Sara•2mo ago
where did you get that impression? 🤣 plus i've noticed the problems with the docs, can you maybe use the #components and write about it there? plus, its always okay to submit a PR for it
Anthony Brooks
Anthony Brooks•2mo ago
If Convex chose you as a mod, then you're representing Convex. To what degree is arguable, I suppose. What is most preferred? The components (or other) forum or?
Sara
Sara•2mo ago
We represent ourselves with our messages, we're volunteers so we're just like you, I suggest the forum just checked the readme.md, it clearly uses the new version countBatch
Anthony Brooks
Anthony Brooks•2mo ago
Yes, as I said in my initial post requesting that the documentation be updated, the readme (clearly) uses it. The documentation for the aggregate component, however, does not (https://www.convex.dev/components/aggregate).

Did you find this page helpful?