TYPE

Since 1.1.0Keys

Syntax

TYPE key
  • Flags: fast, readonly
  • ACL categories: @fast, @generic, @keyspace, @read
  • Arity: 2

Returns the type of the value at key.

Reply

A simple string, one of:

TypeValue
stringa string
lista list
seta set
zseta sorted set
hasha hash
streama stream
ReJSON-RLa JSON document, the name Redis's JSON module uses
noneno such key

Examples

> SET a 1
OK
> TYPE a
string
> JSON.SET j $ 1
OK
> TYPE j
ReJSON-RL
> TYPE missing
none