You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The dataStoreORMGetVerifiableCredentialsCount can be used to count all VCs that have the same type. According to the Implementation the field value from where needs an array like:
We chose to use the simple-array column type defined by TypeORM for the type and @context properties of credentials and presentations because it works essentially with any database driver that TypeORM supports.
Otherwise we would be limited to PostgreSQL or CockroachDB only.
Knowing this, here are some example queries to get credentials by type:
Using the "In" operator (default), or "Equal"
constcredentialsEqual=awaitagent.dataStoreORMGetVerifiableCredentials({where: [{column: 'type',value: ['VerifiableCredential,StatusList2021'],// join the stringsop: 'Equal'// if `op` is not specified, "In" is implied},],});
constcredentialsLike=awaitagent.dataStoreORMGetVerifiableCredentials({where: [{column: 'type',value: ['%StatusList2021%'],// use the Like operation with `%` as the wildcard characterop: 'Like'},],});
Bug severity
2
Describe the bug
The
dataStoreORMGetVerifiableCredentialsCount
can be used to count all VCs that have the same type. According to the Implementation the field value fromwhere
needs an array like:But this will always return 0 since the values of the field type are stored as a joined string and not as an array:
There is also no mentioning in the documentation about this handling...
To Reproduce
Steps to reproduce the behaviour:
Joining the value fields works:
Observed behaviour
According to the specs the
@context
field "MUST" be an ordered set, so an array without nested structures should be the case here.Expected behaviour
Treating the field as a json field and not a string should solve the problem
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: