How do I know the data type of the value of a given key?

后端 未结 2 860
孤城傲影
孤城傲影 2021-02-12 01:34

I can\'t seem to find useful information about Redis commands. I want to know the data type of the value of a given key. For instance to list all the keys of my database I run t

相关标签:
2条回答
  • 2021-02-12 02:00

    See below from docs:

    redis> SET key1 "value"
        "OK"
        redis> LPUSH key2 "value"
        (integer) 1
        redis> SADD key3 "value"
        (integer) 1
        redis> TYPE key1
        "string"
        redis> TYPE key2
        "list"
        redis> TYPE key3
        "set"
        redis> 
    
    0 讨论(0)
  • 2021-02-12 02:16

    You could use the type command: http://redis.io/commands/type

    0 讨论(0)
提交回复
热议问题