JSON.TYPE - Amazon MemoryDB for Redis
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Report type of the values at the given path.


JSON.TYPE <key> [path]
  • key (required) – Redis key of JSON document type

  • path (optional) – a JSON path. Defaults to the root if not provided


If the path is enhanced syntax:

  • Array of strings, representing type of the value at each path. The type is one of {"null", "boolean", "string", "number", "integer", "object" and "array"}.

  • If a path does not exist, its corresponding return value is null.

  • Empty array if the document key does not exist.

If the path is restricted syntax:

  • String, type of the value

  • Null if the document key does not exist.

  • Null if the JSON path is invalid or does not exist.


Enhanced path syntax:> JSON.SET k1 . '[1, 2.3, "foo", true, null, {}, []]' OK> JSON.TYPE k1 $[*] 1) integer 2) number 3) string 4) boolean 5) null 6) object 7) array

Restricted path syntax:> JSON.SET k1 . '{"firstName":"John","lastName":"Smith","age":27,"weight":135.25,"isAlive":true,"address":{"street":"21 2nd Street","city":"New York","state":"NY","zipcode":"10021-3100"},"phoneNumbers":[{"type":"home","number":"212 555-1234"},{"type":"office","number":"646 555-4567"}],"children":[],"spouse":null}' OK> JSON.TYPE k1 object> JSON.TYPE k1 .children array> JSON.TYPE k1 .firstName string> JSON.TYPE k1 .age integer> JSON.TYPE k1 .weight number> JSON.TYPE k1 .isAlive boolean> JSON.TYPE k1 .spouse null