Results 1 to 3 of 3

Thread: Spring Data Key Vale - RedisTemplate question

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    3

    Default 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Mar 2011
    Posts
    3

    Default

    thanks brother!

    I will try this approach

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •