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
139 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,810 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
214 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,040 points
51 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
205 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
• 65,810 points
123 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
• 65,810 points
87 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.