dragonfly
dragonfly copied to clipboard
JSON bugs in the Fakeredis tests
JSON bugs that were found in the Fakeredis tests:
- [x] Fix
WRONGTYPEerror for the JSON legacy mode in theJSON.ARRPOPcommand. It should not return WRONGTYPE for the empy result. Nil is expected. Done by #3683
127.0.0.1:6380> JSON.SET arr . '[]'
OK
127.0.0.1:6380> JSON.ARRPOP arr .
(error) WRONGTYPE wrong JSON type of path value // Result is wrong
- [x] Support the
NOESCAPEoption in theJSON.GETcommand. Done by #3685 - [x] Fix the
JSON.SETbehavior if the path is in legacy mode and is not the root. Done by #3693
127.0.0.1:6379> JSON.SET mykey . '{"name": "Alice", "age": 30}'
OK
127.0.0.1:6379> JSON.SET mykey .address '{"name": "Alice", "age": 30}'
(nil) // Result is wrong. Should return OK
- [x] Support out-of-range indexes for the JSON v2. For the legacy mode we must return an error. Done by #3712
127.0.0.1:6379> JSON.SET arr $ '[0,1,2,3,4]'
OK
127.0.0.1:6379> JSON.ARRTRIM arr $ -1 3
1) (integer) 4 // WRONG. Should return 0
127.0.0.1:6379> JSON.GET arr
"[0,1,2,3]" // WRONG. Should return "[]"
- [x] Separate the double and int values in queries and in the saved json documents. Done by #3711
127.0.0.1:6379> JSON.SET json $ '[2, 3.0, 3]'
OK
127.0.0.1:6379> JSON.ARRINDEX json $ 3
1) (integer) 1 // WRONG. Should return 2
@BagritsevichStepan please do not work on filter expressions for jsonpath v2 - it's too complicated, so lets keep it as a separate (open) task .
@BagritsevichStepan should we close this one?
@BagritsevichStepan should we close this one?
Not yet, will push today pr that finally closes it.