rejson-rb is a package that allows storing, updating and querying objects as JSON documents in a Redis database that is extended with the RedisJSON module. The package extends redis-rb's interface with RedisJSON's API, and performs on-the-fly serialization/deserialization of objects to/from JSON.
Copy the below content and paste it in a file called 'employee.rb'.
The above script uses RedisJSON commands to set the objects, alter the id to 43 and then perform the delete operation using 'json_del'
You can verify what's happening in the background by running the monitor command in Redis CLI shell: