Complete the code to create a new Jedis client connection.
Jedis jedis = new Jedis([1]);The Jedis client connects to Redis using the server address. "127.0.0.1" is the standard localhost IP.
Complete the code to set a key "user" with value "Alice" in Redis using Jedis.
jedis.[1]("user", "Alice");
get which retrieves data instead of setting it.The set method stores a value for a given key in Redis.
Fix the error in the Lettuce code to connect to Redis synchronously.
RedisClient client = RedisClient.create("redis://localhost:6379"); StatefulRedisConnection<String, String> connection = client.[1]();
connectAsync() which returns a future, not a direct connection.The connect() method opens a synchronous connection to Redis in Lettuce.
Fill both blanks to set and then get a key "count" using Jedis.
jedis.[1]("count", "10"); String value = jedis.[2]("count");
del or exists instead of get.First, set stores the value, then get retrieves it.
Fill all three blanks to create a Lettuce client, connect, and set a key "name" to "Bob".
RedisClient client = RedisClient.[1]("redis://localhost:6379"); StatefulRedisConnection<String, String> connection = client.[2](); RedisCommands<String, String> commands = connection.[3](); commands.set("name", "Bob");
open instead of sync for commands.connectAsync with connect.Use create to make the client, connect to open connection, and sync to get synchronous commands.
