0

We have an asset which has an Array of Concepts. And we are tying to query this asset using a condition on this array which is not working.

Sample Model (v0.16.0):

concept MyConcept {  
o String Name  
o String value  
} 

asset MyAsset identified by myAssetId{  
o String myAssetId  
o MyConcept[] myConceptArray   
}

We would like to write a query that would do something like

SELECT MyAsset WHERE myConceptArray CONTAINS {"name":field1, "value": "somevalue"}. 

Is this possible?

Right now, query (CONTAINS) seems to be working only on array of strings.

C B
  • 1,677
  • 6
  • 18
  • 20

1 Answers1

0

as indicated by R Thatcher - adding the following wiki link by way of answer and permanence -> https://github.com/hyperledger/composer-knowledge-wiki/blob/latest/knowledge.md#information_source--queries-and-query-support--examples (scroll down to example entitled CONTAINS Example 3: single-value search (Concept) in a query or CONTAINS Example 4: multi-field Concept with 'OR' example')

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15