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") });
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.