liststreamblockitems filtered by key

+2 votes
Hi Multichain DEV team,

I do need a possibility to query stream items within a blocktime frame (between "from" and "to" datetime). I could use liststreamblockitems for that, but I need to filter items by key additionally. So what I would need is either an additional "key" param for liststreamblockitems or a possibility to query using starttime and endtime using liststreamkeyitems.

Would it be possible to add something like that? Could be a completely new command as well, for sure.

Thanks for a reply in advance, Nils
asked Jul 5, 2022 by nils

1 Answer

–1 vote

I'm afraid there's no immediate solution for this. If we implement it in future, it would probably be done by allowing additional specifiers in liststreamqueryitems to indicate a start time and end time, since this is a general API for more complex queries.

For now I hope you can work with one of the two workarounds you suggested. If you want to make it more efficient, set a low value for maxshowndata, then the API output will be shorter, and you can go back and retrieve individual items using getstreamitem calls.

answered Jul 5, 2022 by MultiChain
My problem is more that there are to many items within the timeframe, so I want to query the data within it in chunks via count/start and provide it paginated from my client. Without a possibility to retrieve data filtered by a key only, I have to filter in my client and build pagination there. That makes it a lot more complicated, but I will have to do it that way for now, then.

Thanks for the answer, would definitely be nice, if the extension to liststreamqueryitems would come.
...