[英]Adding and retrieving Data sets to Redis using StackExchange.Redis
[英]Using REDIS Sets command from StackExchange.Redis
我需要使用一些與set操作相關的redis命令。 我正在使用StackExchange.Redis連接到我的Redis服務器並執行所需的操作。 具體來說,我需要執行以下操作
我可以在IDatabase界面中看到SetAdd,但是如何獲取SDIFF和SINTER命令?
對於命令SDIFF,SUNION或SINTER,應使用IDatabase.SetCombine IDatabase.SetCombine()
方法。
/// <summary>
/// Returns the members of the set resulting from the specified operation against the given sets.
/// </summary>
/// <returns>list with members of the resulting set.</returns>
/// <remarks>http://redis.io/commands/sunion</remarks>
/// <remarks>http://redis.io/commands/sinter</remarks>
/// <remarks>http://redis.io/commands/sdiff</remarks>
RedisValue[] SetCombine(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None);
SetOperation
可以是Union
, Intersect
或Difference
看看一些測試
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.