redisClient.RemoveEntryFromHash(string hashId, string key);
无法删除mutilply键。
我在IRedisNativeClient接口
中找到int HDel(string hashId, byte[] key);
没有mutil键的选项
答案 0 :(得分:0)
尝试滚动自己的扩展方法:
public static void RemoveEntriesFromHash(this IRedisClient client, string hashId, List<string> keys)
{
if (keys == null || keys.Count == 0) return;
var nativeClient = (RedisNativeClient)client;
var keyBytes = new byte[keys.Count][];
var i = 0;
foreach (var key in keys)
{
keyBytes[i] = key.ToUtf8Bytes();
i++;
}
nativeClient.HDel(hashId, keyBytes);
}