Open oren-lava opened 1 month ago
Hi @JulianToledano, Are you working on this? I'll gladly take this on me :)
Hi @JulianToledano, Are you working on this? I'll gladly take this on me :)
sure thing, go ahead!! 👍
Done working on it. Eager to see your review @JulianToledano :)
Summary
Add a
RefKeys()
method to collectionsMultiIterator
to allow iteration over reference keys without explicitly knowing their value.Problem Definition
Assume that an indexed map is created for BaseAccount as described in the Cosmos docs. Now, instead of using an account number as a unique index, we use a multi index which is the origin country of the account.
Normally, many account can share an origin country so the multi index fits perfectly. Now, assume I wish to perform some processing on accounts that share the same country index. Since it's no an integer index, there is no clear set of strings that I can iterate over to check which countries exist in my collection.
If there was a method for a
MultiIterator
to fetch all the existing reference keys, I could iterate over them, use theMatchExact
method and get all the account of a specific country.Proposed Feature
I propose adding a method called
RefKeys()
toMultiIterator
that will have an almost identical implementation of thePrimaryKeys()
method but instead will return a list of the reference keys.