I use the regular redis package to connect my Python code to my Redis server.
As part of my code, I check to see if a string object exists in my Redis server keys.
string = 'abcde' if string in redis.keys(): do something..
For some reason, redis.keys () returns a list with byte objects such as [b'abcde'] , while my string is, of course, a str object.
I already tried to set charset , encoding and decode_responses in my redis generator, but that didn't help.
My goal is to insert the data as a string ahead, rather than iterating over the list of keys and changing each element to str (), checking it.
thanks in advance
source share