PPCM
PPCM

Reputation: 167

Query in an array

I have a model designed like that

asset Myasset identified by assetId {
    o String assetId
    o String[] elements
}

I would to make a query, but I don't found how to request an element in the array. I badly tryed the simple way

query Q1 {
description: "Example query in an array"
statement:
    SELECT zzz.yyy.xxx.Myasset
      WHERE
         (elements[0] == "Request")
}

But it doesn't work

Is there a statement equivalent of the SQL IN ? To have something like

"Request" IN elements

Upvotes: 0

Views: 422

Answers (2)

Monarth Sarvaiya
Monarth Sarvaiya

Reputation: 1126

Currently IN is not supported by Hyperledger Query Language,

You can do like this: (elements CONTAINS "Request")

Already answered here: #1701

Upvotes: 1

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

we do not yet support queries across elements in an array. If you wish to create a Github issue for this, that would be good.

Upvotes: 1

Related Questions