Redis

Frends.Redis.SetValue / 2.1.0

Summary

Writes a value as a string, list or hash, optionally with an expiry after which Redis drops it on its own.

Typical use — caching, and coordination state between Processes — the expiry is what stops abandoned state accumulating

Details

Frends version
5.7 and newer
Agent
Crossplatform
Target framework
net8.0

Data to use in Redis

Name Type Default Example Description
ValueType ValueType String ValueType.String

Type of the value we want to save in Redis

Possible values:

  • String: Type of the value we want to save in Redis

  • Hash: Type of the value we want to save in Redis

  • List: Type of the value we want to save in Redis

  • Set: Type of the value we want to save in Redis

Key String Foo

Key to set

StringValue String Bar

String value to set

ListValue List<String> ["Foo", "Bar"]

List value to set

HashValue Dictionary<String, String> { { "Foo", "Bar" }, { "Moo", "Baz" } }

Dictionary value to set

CollectionOperation Operation Append Operation.Append

Operation that will be executed in case of collection-like type. String values are always overwritten.

Possible values:

  • Append: Operation that will be executed in case of collection-like type. String values are always overwritten.

  • Overwrite: Operation that will be executed in case of collection-like type. String values are always overwritten.

ExpiryInSeconds Nullable<Int32> 3600

Time to live in seconds. Leave empty for infinite.

An unhandled error has occurred. Reload 🗙