Am new to Redis. I am able to store and retrieve data to redis using this commands
hmset user:user1 12 13 14 15
and also am to retrieve data by
hgetall user:user1
i want to do the same using stackExchange.redis on my c# program. how should i do this in c#?
To set multiple values in a hash you can call the following HashSet method overload:
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost");
IDatabase db = redis.GetDatabase();
db.HashSet("user:user1", new HashEntry[] { new HashEntry("12", "13"), new HashEntry("14", "15") });
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