Installing Using the Playground online Installing pre-requisites on Mac OS Installing the Playground locally Installing a development environment
Tutorials
Querying and filtering business network data Queries are used to return data about the blockchain world-state; for example, you could write a query to return all drivers over a specified age, or all drivers with a specific name. The composer-rest-server component exposes named queries via the generated REST API. Queries are an optional component of a business network definition, written in a single query file ( queries.qry ). Note: When using the Hyperledger Fabric v1.0 runtime Hyperledger Fabric must be configured to use CouchDB persistence. Filters are similar to queries, but use the LoopBack filter syntax, and can only be sent using the Hyperledger Composer REST API. Currently, only the WHERE LoopBack filter is supported. The supported operators within WHERE are: =, and, or, gt, gte, lt, lte, neq. Filters are submitted using a GET call against an asset type, participant type, or transaction type; the filter is then supplied as a parameter. Filters return the results from the specified class, and will not return results from classes extending the specified class.
Types of Queries Hyperledger Composer supports two types of queries: named queries and dynamic queries. Named queries are specified in the business network definition and are exposed as GET methods by the composer-rest-server component. Dynamic queries may be constructed dynamically at runtime within a Transaction Processor function, or from client code.
Writing Named Queries Queries must contain a description and a statement. Query descriptions are a string that describe the function of the query. Query statements contain the operators and functions that control the query behavior. Query descriptions can be any descriptive string. A query statement must include the SELECT operator and can optionally include FROM , WHERE , AND , ORDER BY , SKIP , and LIMIT . Queries should take the following format: