You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was writing the documentation for the JSON.OBJLEN command, I made it to be similar to the JSON.OBJKEYS command, which is very similar.
But while investigating, I discovered an inconsistency in the JSON.OBJLEN command; it doesn't return an error message when you use it to query a non-existent key.
To reproduce, try running the JSON.OBJLEN command on a key that you know does not exist in the datastore. You will get a blank response. But it should return an error message saying the key does not exist.
Expected output
If you use the command to query a key that doesn't exist, it should give an error:
dicedb> JSON.OBJLEN nonexistent_key $
(error) ERR could not perform this operation on a key that doesn't exist
This issue will be considered resolved when the following things are done
the implementation for that command is in the evalJSONOBJLEN() function in internal/eval/store_eval.go. Change the EvalResponse object so it returns the diceerrors.ErrKeyDoesNotExist error, instead of nil.
modify test cases in integration_tests for this change.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
When I was writing the documentation for the
JSON.OBJLEN
command, I made it to be similar to theJSON.OBJKEYS
command, which is very similar.But while investigating, I discovered an inconsistency in the
JSON.OBJLEN
command; it doesn't return an error message when you use it to query a non-existent key.To reproduce, try running the
JSON.OBJLEN
command on a key that you know does not exist in the datastore. You will get a blank response. But it should return an error message saying the key does not exist.Expected output
If you use the command to query a key that doesn't exist, it should give an error:
Observed output
Presently, it does not return an error:
dicedb> JSON.OBJLEN nonexistent_key $ Error: redis: nil
Expectations for resolution
This issue will be considered resolved when the following things are done
evalJSONOBJLEN()
function ininternal/eval/store_eval.go
. Change the EvalResponse object so it returns thediceerrors.ErrKeyDoesNotExist
error, instead ofnil
.integration_tests
for this change.The text was updated successfully, but these errors were encountered: