One of the key component is the Query language which resembeles SQL language. In this article I’ll go through how we can build queries for your blockchain application.
In current version of Hyperledger Fabric, the LIMIT and SKIP is not supported it is so in Composer too.
The data model
For this example, I’ll consider the following data model as our application’s data model.
Queries
Get the users based on role. In order to get the list of users based on their roles, we can use the where filter
Also you can give the value from paramater as below
Get users based on organization To get the nodes based on their related or associated files you can use the where with following type
Get Products with quantity more than minimal threshold We can use greater than or lesser than operators in integer or double values as follows.
Using AND operator
Using ORDER BY operator
Using CONTAINS operator
Mostly you can do all the quering with the above mentioned operators, and also I think there will be even more complex queries in the future.
Read More:
Subscribe to our newsletter
Get the latest updates from our team delivered directly to your inbox.
Related Posts
5 advantages of using Hyperledger Fabric for your Enterprise Blockchain
"Why should I use Hyperledger Fabric for my Enterprise Blockchain?", "What is the preferred way of implementing Hyperledger Fabric?". Everything answered.
6 Blockchain frameworks to build Enterprise Blockchain & how to choose them?
Let us help you list some of the open frameworks for blockchain (both public and private blockchain frameworks), that can help you develop your Enterprise Blockchain solution faster and better. Learn more.
Six ways the blockchain can be an advantage for Supply Chain
The blockchain for supply chain is going to be the standard in the industry in the next five years. We've already seen the adoption of the blockchain technology with our supply chain customer, and this article focuses on the advantages that the blockchain has on the supply chain industry.