Redis缓存-使用Redisson访问HMSET
我将Redis缓存-使用Redisson访问HMSET,redis,redis-cache,redisson,Redis,Redis Cache,Redisson,我将HMSET存储在Redis缓存中,如下所示 >hmset [User1] [Key1] [value1] [Key2] [value2] 现在,如何使用Redisson中的User1key来获取键和值映射?另外,如何获取特定密钥和用户的值 我试过了 RMap<String, String> map = client.getMap( "User1" ); RMap-map=client.getMap(“User1”); 但它不起作用。RMap-map=client.ge
HMSET
存储在Redis缓存中,如下所示
>hmset [User1] [Key1] [value1] [Key2] [value2]
现在,如何使用Redisson中的User1
key来获取键和值映射?另外,如何获取特定密钥和用户的值
我试过了
RMap<String, String> map = client.getMap( "User1" );
RMap-map=client.getMap(“User1”);
但它不起作用。RMap-map=client.getMap(“User1”);
RMap<String, String> map = client.getMap( "User1" );
这只为您提供了一个处理程序来操作Redis散列对象,您需要调用get方法来检索您可能需要的那些字段的值。例如:
RMap<String, String> map = client.getMap( "User1" );
Object value1 = map.get("Key1");
Object value2 = map.get("Key2");
RMap-map=client.getMap(“User1”);
对象值1=map.get(“Key1”);
对象值2=map.get(“键2”);