Stroing a list in redis-py

Viewed 28

I'm trying to store a list generated from a dict in my redis db, using the following commands:

x = {'TLV-IST#2022-12-27~2023-01-04': '252', 'TLV-IST#2022-12-27~2023-01-17': '300'}

for key, value in x.items():
    client.lpush(key[:7], key[8:] + '#' + value)

but I'm getting this error:
"WRONGTYPE Operation against a key holding the wrong kind of value"

Although when I'm using a 'regular' string (such as: client.lpush('key', 'value')) it works, what am I doing wrong?

Thanks.

1 Answers
Related