Paginate many to many edge (ents)
Hello, I don't get how to paginate a many to many query on convex-ents:
`
My problem is on this line :
``
6 Replies
For now I've done this as workaround:
``
But I had to add an organizationId field, and not use the edge
It's not supported currently, I filed https://github.com/xixixao/convex-ents/issues/25 for it.
You could hand roll it via ctx.db (you need to paginate the edge table).
GitHub
many:many edge cannot be paginated · Issue #25 · xixixao/convex-ents
This const result = await ctx .table("messages") .getX(messageId) .edge("tags") .paginate(paginationOpts); should paginate the underlying edge table before loading the ents on t...
Ok no problem, any thought on this workaround ?
`
Thank you
paginate is supported on 1:many edges, so since you wanted the end to be optional, another work around would be to a create a "sentinel" group, to which you assign all the users who don't have a group.
For your workaround: Use an index
Yes ok thank you 🙏🏾
@Yvens the pagination for many:many edges is now fixed in 0.9.0