我们可以加入Redis吗? [英] Can we take join in Redis?

查看:139
本文介绍了我们可以加入Redis吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个排序集,SortedSet1 =token=>得分

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

我有一个列表,List1 =token=>username

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

现在,我希望有一个JSON字符串值的记录,如 -

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

例如>token=> {name:username,score:score}

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 ?

推荐答案

redis只是一个键/值存储。你不能做像sql-joins这样的事情。你需要自己做(使用 underscore.js lodash

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).

还有一些在redis中称为LUA脚本的东西。也许这对你有用,但我从来没有用过它,所以我可能无法帮助你: http:// redis.io/commands/eval

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/commands/eval

这篇关于我们可以加入Redis吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆