Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redis缓存-使用Redisson访问HMSET_Redis_Redis Cache_Redisson - Fatal编程技术网

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”);