Skip to content

HGET implementation in Redisson #2200

@rajatppn

Description

@rajatppn

Apologies if this is something simple that I've missed out
Have been trying to figure this out for a while but can't.
Trying to simply get the value associated with field in the hash stored at key as described in the documentation for HGET
The code used is

RedissonClient redisson = Redisson.create();
RMap<String, String> map =  redisson.getMap("myhash");
System.out.println(map.get("a"));

However, it seems like this implementation fetches all values stored in all fields in 'myHash' instead of just the value stored in field 'a'. Unsure if this fetching of values happens during redisson.getMap ( More likely ) or map.get()

Expected behavior

Redisson issues only one HGET and retrieves only the value of field 'a' in hash 'myhash'

Actual behavior

Redisson seems to be fetching values of all fields in 'myhash'

Steps to reproduce or test case

redis-cli

HSET myhash a valueofa
HSET myhash b valueofb
HSET myhash c valueofc

java

RedissonClient redisson = Redisson.create();
RMap<String, String> map =  redisson.getMap("myhash");
System.out.println(map.get("a"));

Redis version

4.0.9

Redisson version

3.10.7

Redisson configuration

Default ( Testing on localhost )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions