Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Wallet Query Language - Sorting #2431

Closed
mturetchi opened this issue Oct 5, 2021 · 2 comments
Closed

Wallet Query Language - Sorting #2431

mturetchi opened this issue Oct 5, 2021 · 2 comments

Comments

@mturetchi
Copy link

mturetchi commented Oct 5, 2021

Hello,
is there any possibility to sort records?
I don't see this documented anywhere and tried different ways in "MongoDB style", but without success...
https://hyperledger-indy.readthedocs.io/projects/sdk/en/latest/docs/design/003-wallet-storage/README.html#wallet-query-language
Can someone help me please?
(I'm not interested in extracting all records and processing them in memory)

@dhh1128
Copy link
Contributor

dhh1128 commented Oct 5, 2021

The short answer is no.

The problem with sorting is that you have to compile all the hits before you can sort them. Some underlying storage mechanisms for wallets support this, but some do not. And sorting would require that data be decrypted (because presumably you'd want sorting based on plaintext, not on the encrypted representation of the data). Thus, supporting sort would change the underlying requirements of wallet storage plugins in a fundamental way. That's one reason not to support the feature.

The other reason not to support the feature is that we don't expect massive numbers of items. If you are seeking to retrieve the set of credentials issued by one party, for example, or the set that match a particular schema, you are probably talking about 2-3 items, not hundreds.

If you truly need sorting, your best bet is to constrain the set of interesting items as much as you can with tags, then fetch all the items and sort them yourself.

@mturetchi
Copy link
Author

I got it, thank you for your answer

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants