JSON.DEL - 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).


Delete the JSON values at the path in a document key. If the path is the root, it is equivalent to deleting the key from Redis.


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

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


  • Number of elements deleted.

  • 0 if the Redis key does not exist.

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


Enhanced path syntax:> JSON.SET k1 . '{"a":{}, "b":{"a":1}, "c":{"a":1, "b":2}, "d":{"a":1, "b":2, "c":3}, "e": [1,2,3,4,5]}' OK> JSON.DEL k1 $.d.* (integer) 3> JSOn.GET k1 "{\"a\":{},\"b\":{\"a\":1},\"c\":{\"a\":1,\"b\":2},\"d\":{},\"e\":[1,2,3,4,5]}"> JSON.DEL k1 $.e[*] (integer) 5> JSOn.GET k1 "{\"a\":{},\"b\":{\"a\":1},\"c\":{\"a\":1,\"b\":2},\"d\":{},\"e\":[]}"

Restricted path syntax:> JSON.SET k1 . '{"a":{}, "b":{"a":1}, "c":{"a":1, "b":2}, "d":{"a":1, "b":2, "c":3}, "e": [1,2,3,4,5]}' OK> JSON.DEL k1 .d.* (integer) 3> JSON.GET k1 "{\"a\":{},\"b\":{\"a\":1},\"c\":{\"a\":1,\"b\":2},\"d\":{},\"e\":[1,2,3,4,5]}"> JSON.DEL k1 .e[*] (integer) 5> JSON.GET k1 "{\"a\":{},\"b\":{\"a\":1},\"c\":{\"a\":1,\"b\":2},\"d\":{},\"e\":[]}"