Skip to content

JSON.DEL doesn't delete all values with recursive descent (..) #529

Closed

Description

@oshadmi
127.0.0.1:6379> JSON.SET doc1 $ '[{"a00": [{"a00": "a00_00"}, {"a01": "a00_01"}, {"a02": "a00_02"}, {"a03": "a00_03"}]}, {"a01": [{"a00": "a01_00"}, {"a01": "a01_01"}, {"a02": "a01_02"}, {"a03": "a01_03"}]}, {"a02": [{"a00": "a02_00"}, {"a01": "a02_01"}, {"a02": "a02_02"}, {"a03": "a02_03"}]}, {"a03": [{"a00": "a03_00"}, {"a01": "a03_01"}, {"a02": "a03_02"}, {"a03": "a03_03"}]}]'
OK
127.0.0.1:6379> JSON.ARRLEN doc1 $.*[*]
1) (integer) 4
2) (integer) 4
3) (integer) 4
4) (integer) 4
127.0.0.1:6379> JSON.DEL doc1 $..[2]
(integer) 3

JSON.DEL should return 4, deleting the entire object containing a02, and each element at index 2 in the other 3 arrays.
The array in the object containing a03, should have lost one element, but it didn't:

127.0.0.1:6379> JSON.ARRLEN doc1 $.*[*]
1) (integer) 3
2) (integer) 3
3) (integer) 4

(last value of the response should have been 3 instead of 4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions