Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Key Vale - RedisTemplate question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Key Vale - RedisTemplate question

    Is there any operation which I can pass through parameter to redisTemplate a List of values and it makes a comparison between the fullsets received via parameter and the content stored on redis memory and return to me a set of values resulted from a intersection between those fullsets?

    Something like this:

    A ∧ B => C

    Where A is a List and B the redisTemplate content already stored and C is the final result from the "merge/intersection" between A and B

    Does redisTemplate has this kind of operation? I tried to find on redisTemplate.opsForList() but I couldnt find it

    Thanks

  • #2
    Redis doesn't support intersection of lists (and thus neither does Spring Data). This is however supported with sets.
    You can convert the list to a set and the problem is solved. If that's not the case then you either have to manually do the intersection (slow and not really efficient) or do a set intersection and then somehow match the remaining items to the list.

    Comment


    • #3
      thanks brother!

      I will try this approach

      Comment

      Working...
      X