Multichain 1.0.4: Querying streams using partial key

+1 vote

Is there a way to use liststreamkeyitems to search for partial key matches? I.e..;

Suppose we have the following keys in our stream: '["foo","bar","foobar","fubar"'].

Is there a way to use liststreamkeyitems to search for keys containing 'foo' to get stream items pointed to by the keys '["foo","foobar"]'?

 

 

asked Aug 1, 2018 by M.Green

2 Answers

0 votes
 
Best answer
I'm afraid this is not yet implemented as a feature of MultiChain. We're constantly evaluating how much general database functionality to integrate into the product, so your request is noted for future development.
answered Aug 3, 2018 by MultiChain
selected Aug 13, 2018 by M.Green
Thank you! It is unfortunate that this feature isn't currently supported, but I'm glad that it might be in MultiChain 2.0!
+1 vote
If you are suggesting a new API method such as liststreamkeyitemswithprefix then you will probably be disappointed as it's not really MultiChain's objective to provide convenience functions for particular use cases that are not popular.

To do this you should manage logs of whatever you are writing to keys in the chain, and query them using 3rd party technologies.

Alternatively make a pull request with the desired implementation for them to consider, but the underlying KV store managing the keys may not support this type of query altogether.
answered Aug 1, 2018 by alexb
I don't mean "with prefix" necessarily, but just being able to do a sort of regular expression search and pull keys that have a partial match.
...