-
Notifications
You must be signed in to change notification settings - Fork 0
/
smemhashes.html
57 lines (50 loc) · 1.19 KB
/
smemhashes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: smemhashes
brief: Gets the contents of all the Hashes whose keys are in a Set
updated: 2014-07-30 18:44
layout: script
sha: c821a39690814ae44488748111c78f0e8ab3b1d0
return: Multi-Bulk - a list of hashes by key
---
<strong>Caveat:</strong> This script violates the EVAL command semantics and
should not be considered safe for Redis Cluster.<br>
<strong>Keys: 1</strong>
<ol class="args">
<li>a Set containing the keys of a series of Hashes.</li>
</ol>
<strong>Args: None</strong><br>
<h2>Example</h2>
<pre class="script-example">
> hset aaron favorites 1
(integer) 1
> hset aaron name aaron
(integer) 1
> hset antirez favorites 10341513551
(integer) 1
> hset antirez name salvatore
(integer) 1
> sadd people aaron
(integer) 1
> sadd people antirez
(integer) 1
> evalsha c821a39690814ae44488748111c78f0e8ab3b1d0 1 people
1) 1) "aaron"
2) 1) "favorites"
2) "1"
3) "name"
4) "aaron"
2) 1) "antirez"
2) 1) "favorites"
2) "10341513551"
3) "name"
4) "salvatore"
</pre>
<h2>Source</h2>
<pre class="script-source">
local keys = redis.call("smembers", KEYS[1])
local ret = {}
for k,v in pairs(keys) do
ret[k] = {v, redis.call("hgetall", v)}
end
return ret
</pre>