[Python] Redis data fetching error, redis.exceptions.ResponseError: WRONGTYPE Operation...

Discussão em 'Python' iniciado por Stack, Março 4, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to fetch the redis data, then

    at first try this script

    pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
    self.redis = redis.Redis(connection_pool=pool)
    for key in self.redis.keys():
    print ("key:",key)


    It shows like this,

    key: b'asgi:group:347'
    key: b'asgi:group:62'
    key: b'asgi:group:344'
    key: b'asgi:group:305'
    key: b'asgi:group:348'


    then I try to check ,

    print(self.redis.get("asgi:group:348"))


    However it shows the error like this, redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value

    How can I get the value of table?

    Continue reading...

Compartilhe esta Página