javascript - Can we take join in Redis? - Stack Overflow

I have a sorted set, SortedSet1 = "token"=>"score"I have a list, List1 = "t

I have a sorted set, SortedSet1 = "token"=>"score"

I have a list, List1 = "token"=>"username"

Now, I want to have a record with JSON string value like-

e.g> "token"=>"{name:username, score: score}"

so that I can broadcast a leaderboard.

How to JOIN these two sets ? Or is there any chance to have JOIN of two lists or two sets ?

I have a sorted set, SortedSet1 = "token"=>"score"

I have a list, List1 = "token"=>"username"

Now, I want to have a record with JSON string value like-

e.g> "token"=>"{name:username, score: score}"

so that I can broadcast a leaderboard.

How to JOIN these two sets ? Or is there any chance to have JOIN of two lists or two sets ?

Share Improve this question asked May 9, 2013 at 4:44 PranavPranav 2,1725 gold badges27 silver badges35 bronze badges 2
  • Or anything like merging of lists on same keys ? – Pranav Commented May 9, 2013 at 4:47
  • where does name e into picture and also List1 look like a hash rather then list – Viren Commented May 9, 2013 at 6:13
Add a ment  | 

2 Answers 2

Reset to default 2

redis is simply a key/value store. you cannot do something like sql-joins. you need to do that by yourself (use underscore.js or lodash for merging).

there is also something that is called LUA-scripting in redis. maybe that will work for you, but i have never worked with it, so i probably cannot help you there: http://redis.io/mands/eval

Here is my approach to doing Joins in Redis. https://www.reddit./r/redis/ments/5iz0gi/joins_in_redis/ The concept is to use sorted sets as indexes, then extracting and doing intersections on the scores.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745539339a4632053.html

相关推荐

  • javascript - Can we take join in Redis? - Stack Overflow

    I have a sorted set, SortedSet1 = "token"=>"score"I have a list, List1 = "t

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信