retrieve latest item/data for a key in a stream

+1 vote


when using getstreamkeysummary:

how can I use it to get the latest data? You can get the first data with noupdate but how can you get the data only from the last change? e.g. the last data change had removal of some json properties but the summary will include the removed properties.

Or is there another fast way to get the latest item "version" with the newest data when there are multiple items for a key?

Do I have to use liststreamkeyitems and check the blocktime value for each items to find the newest change?

Thanks and best regards
asked Jan 8, 2019 by Johannes

1 Answer

+1 vote
Yes, you can use liststreamkeyitems to retrieve the stream items corresponding to a particular key. It will return the stream items starting from the most recent item.
answered Jan 8, 2019 by gimmick
Indeed it sounds like you don't want getstreamkeysummary here at all. The getstreamkeysummary command is for combining multiple stream items together.