How to query to include specific words in hyperledger composer query?

家住魔仙堡 提交于 2019-12-13 04:14:47

问题


I want to query 'a', 'ab', 'abc'

way( where: {field: {like: a%} } ) is unable.

'like' operator is not supported by hyperledger composer filter.

How to query to include specific words in hyperledger composer query?


回答1:


Composer Query Language presently doesn't support 'SQL like' LIKE format such as '%' or regex regexes via CQL, and reliant on the underlying CouchDB Mango QL. Feel free to raise an issue on this at https://github.com/hyperledger/composer/issues/ if you wish.

You would have to do 'OR' matches in your WHERE clause presently - or use CONTAINS in an array field.

See examples of queries used in the Query language here -> https://hyperledger.github.io/composer/latest/tutorials/queries and here -> https://github.com/hyperledger/composer-knowledge-wiki/blob/latest/knowledge.md#information_source--queries-and-query-support--examples (scroll down to item 8 onwards)



来源:https://stackoverflow.com/questions/50433254/how-to-query-to-include-specific-words-in-hyperledger-composer-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!