TYPE

Syntax

  1. TYPE key

Time complexity: O(1)

Returns the string representation of the type of the value stored at key. The different types that can be returned are: string, list, set, zset, hash, stream and ReJSON-RL.

Return

Simple string reply: type of key, or none when key does not exist.

Examples

  1. dragonfly> SET key1 "value"
  2. "OK"
  3. dragonfly> LPUSH key2 "value"
  4. (integer) 1
  5. dragonfly> SADD key3 "value"
  6. (integer) 1
  7. dragonfly> TYPE key1
  8. "string"
  9. dragonfly> TYPE key2
  10. "list"
  11. dragonfly> TYPE key3
  12. "set"