Running Lua scripts in Jedis

Create a Lua script, updateJson.lua, and put it into the Java resources folder. The content of the Lua script can be found in the Using Lua recipe in Chapter 3, Data Features.

Create a Java class, JedisLuaDemo:

The output of the program is:

users:id:992452: {"grade":"C","name":"Tina","sex":"female"} 

Get Redis 4.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.