nitishm / go-rejson

Golang client for redislabs' ReJSON module with support for multilple redis clients (redigo, go-redis)
MIT License
343 stars 47 forks source link

Support json.toggle and json.clear commands #51

Open oshadmi opened 3 years ago

oshadmi commented 3 years ago

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

k-shrey commented 3 years ago

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/

oshadmi commented 3 years ago

Please see this comment

Shivam010 commented 3 years ago

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 \ [path] JSON.TOGGLE \ [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 commented 3 years ago

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