/// <summary> /// Removes the specified fields from the hash stored at key. Non-existing fields are ignored. Non-existing keys are treated as empty hashes and this command returns 0. /// </summary> /// <param name="hashFields">The fields in the hash to delete.</param> /// <returns>The number of fields that were removed.</returns> /// <remarks>https://redis.io/commands/hdel</remarks> public Task <long> DeleteFieldsAsync(string[] hashFields) { if (hashFields == null) { throw new ArgumentNullException(nameof(hashFields)); } return(RedisDb.HashDeleteAsync(KeyName, hashFields.Select(f => new RedisValue(f)).ToArray())); }
/// <summary> /// Removes the asynchronous. /// </summary> /// <param name="key">The key.</param> /// <returns></returns> public async Task <bool> RemoveAsync(TKey key) { return(await RedisDb.HashDeleteAsync(RedisKey, KeySerializer.Serialize(key))); }
/// <summary> /// Removes the specified fields from the hash stored at key. Non-existing fields are ignored. Non-existing keys are treated as empty hashes and this command returns 0. /// </summary> /// <param name="hashField">The field in the hash to delete.</param> /// <remarks>https://redis.io/commands/hdel</remarks> public Task DeleteFieldAsync(string hashField) { return(RedisDb.HashDeleteAsync(KeyName, hashField)); }