当尝试通过调用 RedisConnection.Hashes.Remove(int db, string key, string[] fields, bool queueJump = false) 删除哈希字段时,我收到一个异常消息:“'hdel' 命令的参数数量错误”。
这是产生它的代码:
static void Main(string[] args)
{
var connection = new RedisConnection("localhost");
connection.Open();
var transaction = connection.CreateTransaction();
// setting values to fields - works fine!
for (int index = 0; index < 2; index++)
{
transaction.Hashes.Set(0, "s1", String.Format("f{0}", index.ToString()), String.Format("v{0}", index.ToString()));
}
transaction.Execute().Wait();
// Here is where the exception is being thrown
connection.Hashes.Remove(0, "s1", new string[] { "f1", "f2" }).Wait();
Console.ReadLine();
}
我正在使用从 nuget 获取的 Booksleeve 1.3.37.0。谢谢,