I want to run a custom test query like this:
export default query({
args: {indexName: v.id("table2")},
handler: async (ctx, args) => {
//const foo = 'k97aaays4htqrgyvtcc9ngwsgn7nbkhv' as 'Id<"pods">' // <-- Doesnt work
const page = await ctx.db
.query("table1")
.withIndex("by_some_index", q => q.eq("indexName", args.indexName ))
.paginate({ cursor: null, numItems: 1000 });
return page.page.filter(m => m.isActive !== false).length
}
})
I have bigger problems (I could've reset my aggregates in production unknowingly..but I am trying to run custom queries first). Being able to pass Id<"tableName"> would be awesome
