As per some suggestions, I am using Redis' ZADD
through BookSleeve's SortedSets.Add()
to save data in a chronological order as follows:
TimeSpan span = DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0));
_connection.SortedSets.Add(_db, thisChannel, message, span.TotalSeconds, false);
Using ServiceStack's AdminUI, I can see the values tucked away in Redis.
The values are stored as UTC, and I would now like to be able to get return a range of values.
Simply, since I saved the values recently, I tried:
var subset = _connection.Wait(_connection.SortedSets.Range(_db, thisChannel, span.TotalSeconds - 10000, span.TotalSeconds, offset: 0, count: 50));
In VS, the collection contains the double value, and the Key which is of type Byte[]. I assume this is the byte array of the data saved - even though I saved it as string?
I have reviewed some code here and would like to know if there extensive documentation and some samples on how to use this function?