Hyperledger Composer: How to write complex queries in Composer?

0 votes
We can pass simple pass with the command but what if I have complex queries for larger tasks? How can I pass a complex query?
Nov 20, 2018 in Blockchain by digger
• 27,620 points
200 views

1 answer to this question.

0 votes

You can do this using the query method. 

Syntax:

query queryname{
    description: "Desciption of query"
    statement:
        //query logic
}

Example: 

query Q17 {
    description: "Select all drivers aged older than PARAM"
    statement:
        SELECT org.example.Driver
            WHERE (_$ageParam < age)
}

You can find more details here: https://hyperledger.github.io/composer/unstable/reference/query-language

answered Nov 20, 2018 by Omkar
• 67,120 points

Related Questions In Blockchain

0 votes
1 answer

How to solve EACCES:permission denied error in Hyperledger Composer?

It seems like there is no required ...READ MORE

answered Jul 11, 2018 in Blockchain by digger
• 27,620 points
295 views
0 votes
1 answer

How to solve "error trying install composer runtime" in Hyperledger composer?

I think the docker-compose tool is not ...READ MORE

answered Jul 17, 2018 in Blockchain by slayer
• 29,050 points
66 views
0 votes
1 answer
+1 vote
1 answer

I am unable to change port of composer-rest-server. Please help!

Use full format for running a business ...READ MORE

answered Mar 27, 2018 in Blockchain by Christine
• 15,790 points
247 views
+1 vote
1 answer
0 votes
1 answer

How to get TimeStamps in Hyperledger Composer?

Here's an example that works with basic-sample-network network: asset SampleAsset ...READ MORE

answered Oct 26, 2018 in Blockchain by Omkar
• 67,120 points
179 views
0 votes
1 answer

Hyperledger composer: How to allow create in transaction? Access Control

This is how you can do it: /** @returns ...READ MORE

answered Nov 8, 2018 in Blockchain by Omkar
• 67,120 points
132 views