Dima UtkinD
Convex Community3y ago
10 replies
Dima Utkin

pagination filtering

The solution to these issues (for us, users), imho, is adding an optional extra filtering ability to the paginate function, so we can do smth like this:
const response = await db.query('messages').paginate(
  paginationOpts,
  {
    continueWhile: (message) => message.body.includes('fff'),
  }
)


In this case, we'll end up with a correct cursor on the client, and mostly stable page size.
Maybe it would be very much like the same second option, but done by Convex internally, i'm not sure 🤷‍♂️

wdyt?
Was this page helpful?