Reputation: 166
I want to pass multiple parameters(for example array) using Hyperledger query language. like -
query selectClaimsByMultipleTransanctionID{
description: "Select all claims based on TransactionID"
statement:
SELECT bbc.example.biznet
WHERE (transactionId **in** _$transactionId)
}
But the "In" operator is not available. Can anyone suggest some other way??
Upvotes: 1
Views: 69
Reputation: 1232
Using CONTAINS
operator you can pass multiple parameters.
for example
Model File:
participant User identified by id {
o String id
o String[] hobbies
}
Query:
query Q6 {
description: "Select all users based on given hobbies"
statement:
SELECT ***.User
WHERE (hobbies CONTAINS ['driving', 'swimming','...']
}
Upvotes: 0
Reputation: 6740
Yes - just use CONTAINS
eg. you can do
SELECT ncb1.example.biznet.Claims WHERE (txnArrayValues CONTAINS ["nnn", "nnn", "nnnn"])
where txnArrayValues is String txnArrayValues[]
in your model
See Query guide here -> https://hyperledger.github.io/composer/latest/reference/query-language
Upvotes: 1