Keys and Values

Other topics

Setting Values

All values in Redis are ultimately stored as a RedisValue type:

//"myvalue" here is implicitly converted to a RedisValue type
//The RedisValue type is rarely seen in practice.
db.StringSet("key", "aValue");

Setting and getting an int

db.StringSet("key", 11021);
int i = (int)db.StringGet("key");

Or using StackExchange.Redis.Extensions:

db.Add("key", 11021);
int i = db.Get<int>("key");

Contributors

Topic Id: 11

Example Ids: 19,22

This site is not affiliated with any of the contributors.