platform
platform copied to clipboard
query using `in` operator throws `Identifier expects Buffer`
Using an array of buffer identity Ids:
ownerIds :>> (5) [Uint8Array(32), Uint8Array(32), Uint8Array(32), Uint8Array(32), Uint8Array(32)]
And a query using the in
operator according to https://dashplatform.readme.io/docs/reference-query-syntax#operator-examples
{
where: [["$ownerId", "in", ownerIds]],
}
throws:
Uncaught (in promise) IdentifierError: Identifier expects Buffer
at new Identifier (webpack-internal:///./node_modules/@dashevo/dpp/lib/identifier/Identifier.js:18:11)
at Function.from (webpack-internal:///./node_modules/@dashevo/dpp/lib/identifier/Identifier.js:106:10)
at convertIdentifierProperties (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:93:55)
at eval (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:130:88)
at Array.map (<anonymous>)
at Platform.eval (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:130:49)
at step (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:33:23)
at Object.eval [as next] (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:14:53)
at fulfilled (webpack-internal:///./node_modules/dash/build/src/SDK/Client/Platform/methods/documents/get.js:5:58)
IdentifierError @ IdentifierError.js?93a2:12
Identifier @ Identifier.js?3e2b:18
from @ Identifier.js?3e2b:106
convertIdentifierProperties @ get.js?ae15:93
Same happens for an Array of String identityIds.
see: https://discord.com/channels/670271785974890526/718217459144065045/847055564805767178 and https://discord.com/channels/670271785974890526/670599939528851476/937918648717303838
is this still an issue? the query syntax reference got updated lately https://dashplatform.readme.io/docs/reference-query-syntax#operator-examples
please try a retest considering new updated in the docs for v0.22
IIRC this was a platform bug, not an issue with the actual query. I doubt the updated docs will have changed anything, but perhaps the underlying issue was fixed also.
Hey, may be related to https://github.com/dashevo/platform/issues/315 . Please check your index definitions
It fixed