1
redisClient.RemoveEntryFromHash(string hashId, string key);
不能刪除mutilply密鑰。如何使用ServiceStack.Redis刪除redis哈希中的乘法字段?
我IRedisNativeClient界面找到
int HDel(string hashId, byte[] key);
沒有選項鍵牆身
redisClient.RemoveEntryFromHash(string hashId, string key);
不能刪除mutilply密鑰。如何使用ServiceStack.Redis刪除redis哈希中的乘法字段?
我IRedisNativeClient界面找到
int HDel(string hashId, byte[] key);
沒有選項鍵牆身
嘗試滾動自己的擴展方法:
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);
}