WRONGTYPE Operation against a key holding the wrong kind of value php

前端 未结 3 473
时光说笑
时光说笑 2020-12-22 16:01

Hi I am using Laravel with Redis .When I am trying to access a key by get method then get following error \"WRONGTYPE Operation against a key holding the wrong kind of value

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-22 16:22

    Redis supports 5 data types. You need to know what type of value that a key maps to, as for each data type, the command to retrieve it is different.

    Here are the commands to retrieve key value:

    • if value is of type string -> GET
    • if value is of type hash -> HGETALL
    • if value is of type lists -> lrange
    • if value is of type sets -> smembers
    • if value is of type sorted sets -> ZRANGEBYSCORE

    Use the TYPE command to check the type of value a key is mapping to:

    • type

提交回复
热议问题