I am new to Redis. I want to fetch multiple lists from their keys.
My code is as follows
RedisValue[] valuelist= null;
for each( string item in Key_array){
valuelist = db.ListRange("item");
// do some calculations with the valuelist items.
}
As I am aware, this code has O(n) time complexity. Is there any way to execute this fetching from a single query.
I am using C# with StackExchange.Redis.
Use StackExchange.Redis.Extensions
package
retrieve multiple object with single roundtrip
var cachedData = db.GetAll<T>(new {"key1","key2","key3"});
more information is here https://github.com/imperugo/StackExchange.Redis.Extensions
I hope this help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With