I created a HaskKey using Boolsleve c#, i am providing a unique field each time and my item is Json string.
public virtual void AddHashSetKey(string item, string hashField)
{
_redisClient.Hashes.Set(_database, Key, hashField, item);
}
After adding about thousands fields (141988) i try to check the number of fields in the hash key but get error below. not sure where i can find more details or why am i getting this error?
redis 127.0.0.1:6379[1]> Exists C:
(integer) 1
redis 127.0.0.1:6379[1]> HLEN C:
(error) ERR Operation against a key holding the wrong kind of value
redis 127.0.0.1:6379[1]>
Well, I've looked locally, and it works fine. The main thoughts I have:
select
in redis terms)C:
already had a non-hash value, and therefore the value could not actually be set in the first place? Calling any hash command (includinghset
) will fail if the value is not a hash - so if it already exists as a string: bad thingsSet
; any error will be exposed (when it arrives) via theTask
API, via any ofawait
,.Wait()
,.Result
or.ContinueWith()
(or any otherTask
API of your choice)But locally:
You might also want to try:
which tells you what type of data is stored at
C: