amppA
Convex Community2y ago
82 replies
ampp

Pagination, Take on a edge [ents]

I've been browsing and trying to figure out how to handle this for a few days. Basically i have a many to many between wallets and transactions.

The only efficient way to get the entire transaction history is to do something like .table('wallets')
.getX(wallet._id)
.edge('transactions')

But i cant do a pagination or a take or anything on that on a edge... so i assume anything i do is going to be a full read of all results. And can be thousands of transactions.

The problem is that transactions has a array of to's and a array of from's with a walletid/amount pairing. Which would be bad to index and we want to keep transactions as small as possible.

If i'm not missing something painfully simple, then i'm thinking directly accessing the linking (wallet_to_transaction) table would be smarter.

Perhaps then i could do manual pagination or something, or at least get arrays of ids to use?

Thanks
Was this page helpful?