noob saibotN
Convex Community8mo ago
23 replies
noob saibot

Too many reads in a single function execution (Mutation)

I'm getting this error in a mutation while attempting to delete records in a loop with below code:
await Promise.all(data.map(async obj => {
  await ctx.db.delete(obj._id);
}));

The logs indicate that this error is thrown at the delete line. the array "data" contains exactly 2900 items. I thought that this limitation error occurs only when we're retrieving data.
So I'd just would like to understand what this error means in the context of a (delete) mutation. How do indexes work in this case to limit the number of reads?
Was this page helpful?