go-rejson icon indicating copy to clipboard operation
go-rejson copied to clipboard

Support json.toggle and json.clear commands

Open oshadmi opened this issue 4 years ago • 4 comments

Add support for the following commands: json.toggle json.clear

oshadmi avatar Jul 29 '21 07:07 oshadmi

What do these commands do? Can you provide a link detailing them? Can't seem to find them here https://oss.redislabs.com/redisjson/commands/

k-shrey avatar Aug 01 '21 10:08 k-shrey

Please see this comment

oshadmi avatar Aug 01 '21 13:08 oshadmi

Thanks @oshadmi for the information.

I tried the commands and reviewed the provided test cases of (toggle, clear).

Correct me if I am wrong or I missed something, the specification of both of them is similar to that of json.del.

Syntax JSON.CLEAR <key> [path] JSON.TOGGLE <key> [path]

And json.clear returns 1 or 0 and error similar to that of json.del while json.toggle returns corresponding boolean value and error.

Shivam010 avatar Aug 01 '21 17:08 Shivam010

@oshadmi Feel free to submit a PR, I would be happy to review the changes.

Shivam010 avatar Aug 01 '21 18:08 Shivam010