line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Redis::Database; |
2
|
19
|
|
|
19
|
|
1000
|
use Mojo::Base -base; |
|
19
|
|
|
|
|
35
|
|
|
19
|
|
|
|
|
121
|
|
3
|
|
|
|
|
|
|
|
4
|
19
|
|
|
19
|
|
3097
|
use Scalar::Util 'blessed'; |
|
19
|
|
|
|
|
34
|
|
|
19
|
|
|
|
|
51846
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @BASIC_COMMANDS = ( |
7
|
|
|
|
|
|
|
'append', 'bgrewriteaof', 'bgsave', 'bitcount', |
8
|
|
|
|
|
|
|
'bitfield', 'bitop', 'bitpos', 'client', |
9
|
|
|
|
|
|
|
'cluster', 'config', 'command', 'dbsize', |
10
|
|
|
|
|
|
|
'debug', 'decr', 'decrby', 'del', |
11
|
|
|
|
|
|
|
'dump', 'echo', 'eval', 'evalsha', |
12
|
|
|
|
|
|
|
'exists', 'expire', 'expireat', 'flushall', |
13
|
|
|
|
|
|
|
'flushdb', 'geoadd', 'geohash', 'geopos', |
14
|
|
|
|
|
|
|
'geodist', 'georadius', 'georadiusbymember', 'get', |
15
|
|
|
|
|
|
|
'getbit', 'getrange', 'getset', 'hdel', |
16
|
|
|
|
|
|
|
'hexists', 'hget', 'hgetall', 'hincrby', |
17
|
|
|
|
|
|
|
'hincrbyfloat', 'hkeys', 'hlen', 'hmget', |
18
|
|
|
|
|
|
|
'hmset', 'hset', 'hsetnx', 'hstrlen', |
19
|
|
|
|
|
|
|
'hvals', 'info', 'incr', 'incrby', |
20
|
|
|
|
|
|
|
'incrbyfloat', 'keys', 'lastsave', 'lindex', |
21
|
|
|
|
|
|
|
'linsert', 'llen', 'lpop', 'lpush', |
22
|
|
|
|
|
|
|
'lpushx', 'lrange', 'lrem', 'lset', |
23
|
|
|
|
|
|
|
'ltrim', 'memory', 'mget', 'move', |
24
|
|
|
|
|
|
|
'mset', 'msetnx', 'object', 'persist', |
25
|
|
|
|
|
|
|
'pexpire', 'pexpireat', 'pttl', 'pfadd', |
26
|
|
|
|
|
|
|
'pfcount', 'pfmerge', 'ping', 'psetex', |
27
|
|
|
|
|
|
|
'publish', 'randomkey', 'readonly', 'readwrite', |
28
|
|
|
|
|
|
|
'rename', 'renamenx', 'role', 'rpop', |
29
|
|
|
|
|
|
|
'rpoplpush', 'rpush', 'rpushx', 'restore', |
30
|
|
|
|
|
|
|
'sadd', 'save', 'scard', 'script', |
31
|
|
|
|
|
|
|
'sdiff', 'sdiffstore', 'set', 'setbit', |
32
|
|
|
|
|
|
|
'setex', 'setnx', 'setrange', 'sinter', |
33
|
|
|
|
|
|
|
'sinterstore', 'sismember', 'slaveof', 'slowlog', |
34
|
|
|
|
|
|
|
'smembers', 'smove', 'sort', 'spop', |
35
|
|
|
|
|
|
|
'srandmember', 'srem', 'strlen', 'sunion', |
36
|
|
|
|
|
|
|
'sunionstore', 'time', 'touch', 'ttl', |
37
|
|
|
|
|
|
|
'type', 'unlink', 'xadd', 'xrange', |
38
|
|
|
|
|
|
|
'xrevrange', 'xlen', 'xread', 'xreadgroup', |
39
|
|
|
|
|
|
|
'xpending', 'zadd', 'zcard', 'zcount', |
40
|
|
|
|
|
|
|
'zincrby', 'zinterstore', 'zlexcount', 'zpopmax', |
41
|
|
|
|
|
|
|
'zpopmin', 'zrange', 'zrangebylex', 'zrangebyscore', |
42
|
|
|
|
|
|
|
'zrank', 'zrem', 'zremrangebylex', 'zremrangebyrank', |
43
|
|
|
|
|
|
|
'zremrangebyscore', 'zrevrange', 'zrevrangebylex', 'zrevrangebyscore', |
44
|
|
|
|
|
|
|
'zrevrank', 'zscore', 'zunionstore', |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
our @BLOCKING_COMMANDS = ('blpop', 'brpop', 'brpoplpush', 'bzpopmax', 'bzpopmin'); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has redis => sub { Carp::confess('redis is required in constructor') }; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__PACKAGE__->_add_method('bnb,p' => $_) for @BASIC_COMMANDS; |
52
|
|
|
|
|
|
|
__PACKAGE__->_add_method('nb,p' => $_) for @BLOCKING_COMMANDS; |
53
|
|
|
|
|
|
|
__PACKAGE__->_add_method('bnb' => qw(_exec EXEC)); |
54
|
|
|
|
|
|
|
__PACKAGE__->_add_method('bnb' => qw(_discard DISCARD)); |
55
|
|
|
|
|
|
|
__PACKAGE__->_add_method('bnb' => qw(_multi MULTI)); |
56
|
|
|
|
|
|
|
__PACKAGE__->_add_method('bnb,p' => "${_}_structured", $_) for qw(info xread); |
57
|
|
|
|
|
|
|
__PACKAGE__->_add_method('bnb,p' => $_) for qw(unwatch watch); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub call { |
60
|
0
|
0
|
|
0
|
1
|
0
|
my $cb = ref $_[-1] eq 'CODE' ? pop : undef; |
61
|
0
|
|
|
|
|
0
|
my $self = shift; |
62
|
0
|
0
|
|
|
|
0
|
my $p = $self->connection($cb ? 0 : 1)->write_p(@_); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Non-blocking |
65
|
0
|
0
|
|
|
|
0
|
if ($cb) { |
66
|
0
|
|
|
0
|
|
0
|
$p->then(sub { $self->$cb('', @_) })->catch(sub { $self->$cb(shift, undef) }); |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
67
|
0
|
|
|
|
|
0
|
return $self; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# Blocking |
71
|
0
|
|
|
|
|
0
|
my ($err, @res); |
72
|
0
|
|
|
0
|
|
0
|
$p->then(sub { @res = @_ })->catch(sub { $err = shift })->wait; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
73
|
0
|
0
|
|
|
|
0
|
die $err if $err; |
74
|
0
|
|
|
|
|
0
|
return @res; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub call_p { |
78
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
79
|
0
|
|
|
0
|
|
0
|
return $self->connection->write_p(@_)->then(sub { $self = undef; @_ }); |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
1
|
1
|
290
|
sub exec { delete $_[0]->{txn}; shift->_exec(@_) } |
|
1
|
|
|
|
|
17
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub exec_p { |
85
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
86
|
0
|
|
|
|
|
0
|
delete $self->{txn}; |
87
|
0
|
|
|
|
|
0
|
return $self->connection->write_p('EXEC'); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
0
|
1
|
0
|
sub discard { delete $_[0]->{txn}; shift->_discard(@_) } |
|
0
|
|
|
|
|
0
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub discard_p { |
93
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
94
|
0
|
|
|
|
|
0
|
delete $self->{txn}; |
95
|
0
|
|
|
|
|
0
|
return $self->connection->write_p('DISCARD'); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub multi { |
99
|
1
|
50
|
|
1
|
1
|
17
|
$_[0]->{txn} = ref $_[-1] eq 'CODE' ? 'default' : 'blocking'; |
100
|
1
|
|
|
|
|
5
|
return shift->_multi(@_); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub multi_p { |
104
|
0
|
|
|
0
|
1
|
0
|
my ($self, @p) = @_; |
105
|
0
|
0
|
|
|
|
0
|
Carp::croak('multi_p(@promises) syntax is not supported anymore. Use promise chaining instead.') |
106
|
|
|
|
|
|
|
if @p; |
107
|
0
|
|
|
|
|
0
|
$self->{txn} = 'default'; |
108
|
0
|
|
|
|
|
0
|
return $self->connection->write_p('MULTI'); |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub _add_method { |
112
|
3097
|
|
|
3097
|
|
43261
|
my ($class, $types, $method, $op) = @_; |
113
|
3097
|
|
|
|
|
4164
|
my $caller = caller; |
114
|
3097
|
|
|
|
|
16256
|
my $process = $caller->can(lc "_process_$method"); |
115
|
|
|
|
|
|
|
|
116
|
3097
|
|
66
|
|
|
11067
|
$op ||= uc $method; |
117
|
|
|
|
|
|
|
|
118
|
3097
|
|
|
|
|
6157
|
for my $type (split /,/, $types) { |
119
|
6137
|
100
|
|
|
|
58321
|
Mojo::Util::monkey_patch( |
120
|
|
|
|
|
|
|
$caller, |
121
|
|
|
|
|
|
|
$type eq 'p' ? "${method}_p" : $method, |
122
|
|
|
|
|
|
|
$class->can("_generate_${type}_method")->($class, $op, $process) |
123
|
|
|
|
|
|
|
); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub connection { |
128
|
19
|
|
|
19
|
1
|
497
|
my $self = shift; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# Back compat: $self->connection(Mojo::Redis::Connection->new); |
131
|
19
|
50
|
33
|
|
|
88
|
$self->{_conn_dequeue} = shift if blessed $_[0] and $_[0]->isa('Mojo::Redis::Connection'); |
132
|
|
|
|
|
|
|
|
133
|
19
|
100
|
|
|
|
55
|
my $method = $_[0] ? '_blocking_connection' : '_dequeue'; |
134
|
19
|
|
66
|
|
|
117
|
return $self->{"_conn$method"} ||= $self->redis->$method; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub _generate_bnb_method { |
138
|
3002
|
|
|
3002
|
|
4719
|
my ($class, $op, $process) = @_; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
return sub { |
141
|
4
|
50
|
|
4
|
|
343
|
my $cb = ref $_[-1] eq 'CODE' ? pop : undef; |
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
142
|
4
|
|
|
|
|
7
|
my $self = shift; |
143
|
|
|
|
|
|
|
|
144
|
4
|
50
|
|
|
|
12
|
my $p = $self->connection($cb ? 0 : 1)->write_p($op, @_); |
145
|
4
|
50
|
|
0
|
|
14
|
$p = $p->then(sub { $self->$process(@_) }) if $process; |
|
0
|
|
|
|
|
0
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# Non-blocking |
148
|
4
|
50
|
|
|
|
9
|
if ($cb) { |
149
|
0
|
|
|
0
|
|
0
|
$p->then(sub { $self->$cb('', @_) })->catch(sub { $self->$cb(shift, undef) }); |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
150
|
0
|
|
|
|
|
0
|
return $self; |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
# Blocking |
154
|
4
|
|
|
|
|
6
|
my ($err, $res); |
155
|
4
|
|
|
3
|
|
15
|
$p->then(sub { $res = shift })->catch(sub { $err = shift })->wait; |
|
1
|
|
|
|
|
141
|
|
|
3
|
|
|
|
|
1047
|
|
156
|
4
|
100
|
|
|
|
2058
|
die $err if defined $err; |
157
|
1
|
|
|
|
|
24
|
return $res; |
158
|
3002
|
|
|
|
|
15668
|
}; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub _generate_nb_method { |
162
|
95
|
|
|
95
|
|
178
|
my ($class, $op, $process) = @_; |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
return sub { |
165
|
0
|
|
|
0
|
|
0
|
my ($self, $cb) = (shift, pop); |
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
166
|
0
|
0
|
|
0
|
|
0
|
$self->connection->write_p(@_)->then(sub { $self->$cb('', $process ? $self->$process(@_) : @_) }) |
167
|
0
|
|
|
0
|
|
0
|
->catch(sub { $self->$cb(shift, undef) }); |
|
0
|
|
|
|
|
0
|
|
168
|
0
|
|
|
|
|
0
|
return $self; |
169
|
95
|
|
|
|
|
524
|
}; |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub _generate_p_method { |
173
|
3040
|
|
|
3040
|
|
5178
|
my ($class, $op, $process) = @_; |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
return sub { |
176
|
4
|
|
|
4
|
|
113
|
my $self = shift; |
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
4
|
|
|
|
177
|
|
|
|
|
|
|
$self->connection->write_p($op => @_)->then(sub { |
178
|
1
|
50
|
|
1
|
|
173
|
return $process ? $self->$process(@_) : @_; |
179
|
4
|
|
|
|
|
15
|
}); |
180
|
3040
|
|
|
|
|
13205
|
}; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
sub _process_geopos { |
184
|
0
|
0
|
|
0
|
|
0
|
ref $_[1] eq 'ARRAY' ? [map { ref $_ ? +{lng => $_->[0], lat => $_->[1]} : undef } @{$_[1]}] : $_[1]; |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
185
|
|
|
|
|
|
|
} |
186
|
0
|
0
|
|
0
|
|
0
|
sub _process_blpop { ref $_[1] eq 'ARRAY' ? reverse @{$_[1]} : $_[1] } |
|
0
|
|
|
|
|
0
|
|
187
|
0
|
0
|
|
0
|
|
0
|
sub _process_brpop { ref $_[1] eq 'ARRAY' ? reverse @{$_[1]} : $_[1] } |
|
0
|
|
|
|
|
0
|
|
188
|
0
|
0
|
|
0
|
|
0
|
sub _process_hgetall { ref $_[1] eq 'ARRAY' ? +{@{$_[1]}} : $_[1] } |
|
0
|
|
|
|
|
0
|
|
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
sub _process_info_structured { |
191
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
192
|
0
|
|
|
|
|
0
|
my $section = {}; |
193
|
0
|
|
|
|
|
0
|
my %res; |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
0
|
for (split /\r\n/, $_[0]) { |
196
|
0
|
0
|
|
|
|
0
|
if (/^\#\s+(\S+)/) { |
|
|
0
|
|
|
|
|
|
197
|
0
|
|
|
|
|
0
|
$section = $res{lc $1} = {}; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
elsif (/(\S+):(\S+)/) { |
200
|
0
|
|
|
|
|
0
|
$section->{$1} = $2; |
201
|
|
|
|
|
|
|
} |
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
|
204
|
0
|
0
|
|
|
|
0
|
return keys %res == 1 ? $section : \%res; |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
sub _process_xread_structured { |
208
|
0
|
0
|
|
0
|
|
0
|
return $_[1] unless ref $_[1] eq 'ARRAY'; |
209
|
0
|
|
|
|
|
0
|
return {map { ($_->[0] => $_->[1]) } @{$_[1]}}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub DESTROY { |
213
|
12
|
|
|
12
|
|
6887
|
my $self = shift; |
214
|
|
|
|
|
|
|
|
215
|
12
|
50
|
66
|
|
|
118
|
if (my $txn = delete $self->{txn}) { |
|
|
100
|
|
|
|
|
|
216
|
0
|
0
|
|
|
|
0
|
$self->connection(1)->write_p('DISCARD')->wait if $txn eq 'blocking'; |
217
|
|
|
|
|
|
|
} |
218
|
|
|
|
|
|
|
elsif (my $redis = $self->{redis} and my $conn = $self->{_conn_dequeue}) { |
219
|
10
|
|
|
|
|
57
|
$redis->_enqueue($conn); |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
1; |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=encoding utf8 |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=head1 NAME |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
Mojo::Redis::Database - Execute basic redis commands |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head1 SYNOPSIS |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
use Mojo::Redis; |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
my $redis = Mojo::Redis->new; |
236
|
|
|
|
|
|
|
my $db = $redis->db; |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# Blocking |
239
|
|
|
|
|
|
|
say "foo=" .$db->get("foo"); |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
# Non-blocking |
242
|
|
|
|
|
|
|
$db->get(foo => sub { my ($db, $res) = @_; say "foo=$res" }); |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
# Promises |
245
|
|
|
|
|
|
|
$db->get_p("foo")->then(sub { my ($res) = @_; say "foo=$res" }); |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
See L |
248
|
|
|
|
|
|
|
for example L application. |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=head1 DESCRIPTION |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
L has methods for sending and receiving structured |
253
|
|
|
|
|
|
|
data to the Redis server. |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=head2 redis |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
$conn = $db->redis; |
260
|
|
|
|
|
|
|
$db = $db->redis(Mojo::Redis->new); |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
Holds a L object used to create the connections to talk with Redis. |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=head1 METHODS |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
=head2 append |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
$int = $db->append($key, $value); |
269
|
|
|
|
|
|
|
$db = $db->append($key, $value, sub { my ($db, $err, $int) = @_ }); |
270
|
|
|
|
|
|
|
$promise = $db->append_p($key, $value); |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
Append a value to a key. |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
See L for more information. |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=head2 bgrewriteaof |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
$ok = $db->bgrewriteaof; |
279
|
|
|
|
|
|
|
$db = $db->bgrewriteaof(sub { my ($db, $err, $ok) = @_ }); |
280
|
|
|
|
|
|
|
$promise = $db->bgrewriteaof_p; |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Asynchronously rewrite the append-only file. |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
See L for more information. |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
=head2 bgsave |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
$ok = $db->bgsave; |
289
|
|
|
|
|
|
|
$db = $db->bgsave(sub { my ($db, $err, $ok) = @_ }); |
290
|
|
|
|
|
|
|
$promise = $db->bgsave_p; |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
Asynchronously save the dataset to disk. |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
See L for more information. |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
=head2 bitcount |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
$int = $db->bitcount($key, [start end]); |
299
|
|
|
|
|
|
|
$db = $db->bitcount($key, [start end], sub { my ($db, $err, $int) = @_ }); |
300
|
|
|
|
|
|
|
$promise = $db->bitcount_p($key, [start end]); |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
Count set bits in a string. |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
See L for more information. |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=head2 bitfield |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
$res = $db->bitfield($key, [GET type offset], [SET type offset value], [INCRBY type offset increment], [OVERFLOW WRAP|SAT|FAIL]); |
309
|
|
|
|
|
|
|
$db = $db->bitfield($key, [GET type offset], [SET type offset value], [INCRBY type offset increment], [OVERFLOW WRAP|SAT|FAIL], sub { my ($db, $err, $res) = @_ }); |
310
|
|
|
|
|
|
|
$promise = $db->bitfield_p($key, [GET type offset], [SET type offset value], [INCRBY typeoffset increment], [OVERFLOW WRAP|SAT|FAIL]); |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
Perform arbitrary bitfield integer operations on strings. |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
See L for more information. |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=head2 bitop |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
$int = $db->bitop($operation, $destkey, $key [key ...]); |
319
|
|
|
|
|
|
|
$db = $db->bitop($operation, $destkey, $key [key ...], sub { my ($db, $err, $int) = @_ }); |
320
|
|
|
|
|
|
|
$promise = $db->bitop_p($operation, $destkey, $key [key ...]); |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
Perform bitwise operations between strings. |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
See L for more information. |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=head2 bitpos |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
$int = $db->bitpos($key, $bit, [start], [end]); |
329
|
|
|
|
|
|
|
$db = $db->bitpos($key, $bit, [start], [end], sub { my ($db, $err, $int) = @_ }); |
330
|
|
|
|
|
|
|
$promise = $db->bitpos_p($key, $bit, [start], [end]); |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
Find first bit set or clear in a string. |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
See L for more information. |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=head2 blpop |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
$db = $db->blpop($key [key ...], $timeout, sub { my ($db, $val, $key) = @_ }); |
339
|
|
|
|
|
|
|
$promise = $db->blpop_p($key [key ...], $timeout); |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
Remove and get the first element in a list, or block until one is available. |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
See L for more information. |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=head2 brpop |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
$db = $db->brpop($key [key ...], $timeout, sub { my ($db, $val, $key) = @_ }); |
348
|
|
|
|
|
|
|
$promise = $db->brpop_p($key [key ...], $timeout); |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
Remove and get the last element in a list, or block until one is available. |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
See L for more information. |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=head2 brpoplpush |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
$db = $db->brpoplpush($source, $destination, $timeout, sub { my ($db, $err, $array_ref) = @_ }); |
357
|
|
|
|
|
|
|
$promise = $db->brpoplpush_p($source, $destination, $timeout); |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
Pop a value from a list, push it to another list and return it; or block until one is available. |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
See L for more information. |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=head2 bzpopmax |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
$db = $db->bzpopmax($key [key ...], $timeout, sub { my ($db, $err, $array_ref) = @_ }); |
366
|
|
|
|
|
|
|
$promise = $db->bzpopmax_p($key [key ...], $timeout); |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
Remove and return the member with the highest score from one or more sorted sets, or block until one is available. |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
See L for more information. |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=head2 bzpopmin |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
$db = $db->bzpopmin($key [key ...], $timeout, sub { my ($db, $err, $array_ref) = @_ }); |
375
|
|
|
|
|
|
|
$promise = $db->bzpopmin_p($key [key ...], $timeout); |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
Remove and return the member with the lowest score from one or more sorted sets, or block until one is available. |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
See L for more information. |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=head2 call |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
$res = $db->call($command => @args); |
384
|
|
|
|
|
|
|
$db = $db->call($command => @args, sub { my ($db, $err, $res) = @_; }); |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
Same as L, but either blocks or passes the result into a callback. |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=head2 call_p |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
$promise = $db->call_p($command => @args); |
391
|
|
|
|
|
|
|
$promise = $db->call_p(GET => "some:key"); |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
Used to send a custom command to the Redis server. |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head2 client |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
$res = $db->client(@args); |
398
|
|
|
|
|
|
|
$db = $db->client(@args, sub { my ($db, $err, $res) = @_ }); |
399
|
|
|
|
|
|
|
$promise = $db->client_p(@args); |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
Run a "CLIENT" command on the server. C<@args> can be: |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=over 2 |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=item * KILL [ip:port] [ID client-id] [TYPE normal|master|slave|pubsub] [ADDR ip:port] [SKIPME yes/no] |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=item * LIST |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=item * GETNAME |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=item * PAUSE timeout |
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=item * REPLY [ON|OFF|SKIP] |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=item * SETNAME connection-name |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=back |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
See L for more information. |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=head2 connection |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
$non_blocking_connection = $db->connection(0); |
424
|
|
|
|
|
|
|
$blocking_connection = $db->connection(1); |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
Returns a L object. The default is to return a |
427
|
|
|
|
|
|
|
connection suitable for non-blocking methods, but passing in a true value will |
428
|
|
|
|
|
|
|
return the connection used for blocking methods. |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
# Blocking |
431
|
|
|
|
|
|
|
my $res = $db->get("some:key"); |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
# Non-blocking |
434
|
|
|
|
|
|
|
$db->get_p("some:key"); |
435
|
|
|
|
|
|
|
$db->get("some:key", sub { ... }); |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=head2 cluster |
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
$res = $db->cluster(@args); |
440
|
|
|
|
|
|
|
$db = $db->cluster(@args, sub { my ($db, $err, $res) = @_ }); |
441
|
|
|
|
|
|
|
$promise = $db->cluster_p(@args); |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
Used to execute cluster commands. |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
See L for more information. |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=head2 command |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
$array_ref = $db->command(@args); |
450
|
|
|
|
|
|
|
$db = $db->command(@args, sub { my ($db, $err, $array_ref) = @_ }); |
451
|
|
|
|
|
|
|
$promise = $db->command_p(@args); |
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
Get array of Redis command details. |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
=over 2 |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=item * empty list |
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=item * COUNT |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
=item * GETKEYS |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
=item * INFO command-name [command-name] |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=back |
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
See L for more information. |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=head2 dbsize |
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
$int = $db->dbsize; |
472
|
|
|
|
|
|
|
$db = $db->dbsize(sub { my ($db, $err, $int) = @_ }); |
473
|
|
|
|
|
|
|
$promise = $db->dbsize_p; |
474
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
Return the number of keys in the selected database. |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
See L for more information. |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
=head2 decr |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
$num = $db->decr($key); |
482
|
|
|
|
|
|
|
$db = $db->decr($key, sub { my ($db, $err, $num) = @_ }); |
483
|
|
|
|
|
|
|
$promise = $db->decr_p($key); |
484
|
|
|
|
|
|
|
|
485
|
|
|
|
|
|
|
Decrement the integer value of a key by one. |
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
See L for more information. |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
=head2 decrby |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
$num = $db->decrby($key, $decrement); |
492
|
|
|
|
|
|
|
$db = $db->decrby($key, $decrement, sub { my ($db, $err, $num) = @_ }); |
493
|
|
|
|
|
|
|
$promise = $db->decrby_p($key, $decrement); |
494
|
|
|
|
|
|
|
|
495
|
|
|
|
|
|
|
Decrement the integer value of a key by the given number. |
496
|
|
|
|
|
|
|
|
497
|
|
|
|
|
|
|
See L for more information. |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=head2 del |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
$ok = $db->del($key [key ...]); |
502
|
|
|
|
|
|
|
$db = $db->del($key [key ...], sub { my ($db, $err, $ok) = @_ }); |
503
|
|
|
|
|
|
|
$promise = $db->del_p($key [key ...]); |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
Delete a key. |
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
See L for more information. |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
=head2 discard |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
See L. |
512
|
|
|
|
|
|
|
|
513
|
|
|
|
|
|
|
=head2 discard_p |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
$ok = $db->discard; |
516
|
|
|
|
|
|
|
$db = $db->discard(sub { my ($db, $err, $ok) = @_ }); |
517
|
|
|
|
|
|
|
$promise = $db->discard_p; |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
Discard all commands issued after MULTI. |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
See L for more information. |
522
|
|
|
|
|
|
|
|
523
|
|
|
|
|
|
|
=head2 dump |
524
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
$ok = $db->dump($key); |
526
|
|
|
|
|
|
|
$db = $db->dump($key, sub { my ($db, $err, $ok) = @_ }); |
527
|
|
|
|
|
|
|
$promise = $db->dump_p($key); |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
Return a serialized version of the value stored at the specified key. |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
See L for more information. |
532
|
|
|
|
|
|
|
|
533
|
|
|
|
|
|
|
=head2 echo |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
$res = $db->echo($message); |
536
|
|
|
|
|
|
|
$db = $db->echo($message, sub { my ($db, $err, $res) = @_ }); |
537
|
|
|
|
|
|
|
$promise = $db->echo_p($message); |
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
Echo the given string. |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
See L for more information. |
542
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
=head2 eval |
544
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
$res = $db->eval($script, $numkeys, $key [key ...], $arg [arg ...]); |
546
|
|
|
|
|
|
|
$db = $db->eval($script, $numkeys, $key [key ...], $arg [arg ...], sub { my ($db, $err, $res) = @_ }); |
547
|
|
|
|
|
|
|
$promise = $db->eval_p($script, $numkeys, $key [key ...], $arg [arg ...]); |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
Execute a Lua script server side. |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
See L for more information. |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
=head2 evalsha |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
$res = $db->evalsha($sha1, $numkeys, $key [key ...], $arg [arg ...]); |
556
|
|
|
|
|
|
|
$db = $db->evalsha($sha1, $numkeys, $key [key ...], $arg [arg ...], sub { my ($db, $err, $res) = @_ }); |
557
|
|
|
|
|
|
|
$promise = $db->evalsha_p($sha1, $numkeys, $key [key ...], $arg [arg ...]); |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
Execute a Lua script server side. |
560
|
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
See L for more information. |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
=head2 exec |
564
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
See L. |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
=head2 exec_p |
568
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
$array_ref = $db->exec; |
570
|
|
|
|
|
|
|
$db = $db->exec(sub { my ($db, $err, $array_ref) = @_ }); |
571
|
|
|
|
|
|
|
$promise = $db->exec_p; |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
Execute all commands issued after L. |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
See L for more information. |
576
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
=head2 exists |
578
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
$int = $db->exists($key [key ...]); |
580
|
|
|
|
|
|
|
$db = $db->exists($key [key ...], sub { my ($db, $err, $int) = @_ }); |
581
|
|
|
|
|
|
|
$promise = $db->exists_p($key [key ...]); |
582
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
Determine if a key exists. |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
See L for more information. |
586
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
=head2 expire |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
$int = $db->expire($key, $seconds); |
590
|
|
|
|
|
|
|
$db = $db->expire($key, $seconds, sub { my ($db, $err, $int) = @_ }); |
591
|
|
|
|
|
|
|
$promise = $db->expire_p($key, $seconds); |
592
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
Set a key's time to live in seconds. |
594
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
See L for more information. |
596
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
=head2 expireat |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
$int = $db->expireat($key, $timestamp); |
600
|
|
|
|
|
|
|
$db = $db->expireat($key, $timestamp, sub { my ($db, $err, $int) = @_ }); |
601
|
|
|
|
|
|
|
$promise = $db->expireat_p($key, $timestamp); |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
Set the expiration for a key as a UNIX timestamp. |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
See L for more information. |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
=head2 flushall |
608
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
$str = $db->flushall([ASYNC]); |
610
|
|
|
|
|
|
|
$db = $db->flushall([ASYNC], sub { my ($db, $err, $str) = @_ }); |
611
|
|
|
|
|
|
|
$promise = $db->flushall_p([ASYNC]); |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
Remove all keys from all databases. |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
See L for more information. |
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
=head2 flushdb |
618
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
$str = $db->flushdb([ASYNC]); |
620
|
|
|
|
|
|
|
$db = $db->flushdb([ASYNC], sub { my ($db, $err, $str) = @_ }); |
621
|
|
|
|
|
|
|
$promise = $db->flushdb_p([ASYNC]); |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
Remove all keys from the current database. |
624
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
See L for more information. |
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
=head2 geoadd |
628
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
$res = $db->geoadd($key, $longitude latitude member [longitude latitude member ...]); |
630
|
|
|
|
|
|
|
$db = $db->geoadd($key, $longitude latitude member [longitude latitude member ...], sub { my ($db, $err, $res) = @_ }); |
631
|
|
|
|
|
|
|
$promise = $db->geoadd_p($key, $longitude latitude member [longitude latitude member ...]); |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
Add one or more geospatial items in the geospatial index represented using a sorted set. |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
See L for more information. |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
=head2 geodist |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
$res = $db->geodist($key, $member1, $member2, [unit]); |
640
|
|
|
|
|
|
|
$db = $db->geodist($key, $member1, $member2, [unit], sub { my ($db, $err, $res) = @_ }); |
641
|
|
|
|
|
|
|
$promise = $db->geodist_p($key, $member1, $member2, [unit]); |
642
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
Returns the distance between two members of a geospatial index. |
644
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
See L for more information. |
646
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
=head2 geohash |
648
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
$res = $db->geohash($key, $member [member ...]); |
650
|
|
|
|
|
|
|
$db = $db->geohash($key, $member [member ...], sub { my ($db, $err, $res) = @_ }); |
651
|
|
|
|
|
|
|
$promise = $db->geohash_p($key, $member [member ...]); |
652
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
Returns members of a geospatial index as standard geohash strings. |
654
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
See L for more information. |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
=head2 geopos |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
$array_ref = $db->geopos($key, $member [member ...]); |
660
|
|
|
|
|
|
|
$db = $db->geopos($key, $member [member ...], sub { my ($db, $err, $array_ref) = @_ }); |
661
|
|
|
|
|
|
|
$promise = $db->geopos_p($key, $member [member ...]); |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
Returns longitude and latitude of members of a geospatial index: |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
[{lat => $num, lng => $num}, ...] |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
See L for more information. |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
=head2 georadius |
670
|
|
|
|
|
|
|
|
671
|
|
|
|
|
|
|
$res = $db->georadius($key, $longitude, $latitude, $radius, $m|km|ft|mi, [WITHCOORD],[WITHDIST], [WITHHASH], [COUNT count], [ASC|DESC], [STORE key], [STOREDIST key]); |
672
|
|
|
|
|
|
|
$db = $db->georadius($key, $longitude, $latitude, $radius, $m|km|ft|mi, [WITHCOORD],[WITHDIST], [WITHHASH], [COUNT count], [ASC|DESC], [STORE key], [STOREDIST key], sub { my ($db, $err, $res) = @_ }); |
673
|
|
|
|
|
|
|
$promise = $db->georadius_p($key, $longitude, $latitude, $radius, $m|km|ft|mi, [WITHCOORD], [WITHDIST], [WITHHASH], [COUNT count], [ASC|DESC], [STORE key], [STOREDIST key]); |
674
|
|
|
|
|
|
|
|
675
|
|
|
|
|
|
|
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a point. |
676
|
|
|
|
|
|
|
|
677
|
|
|
|
|
|
|
See L for more information. |
678
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
=head2 georadiusbymember |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
$res = $db->georadiusbymember($key, $member, $radius, $m|km|ft|mi, [WITHCOORD], [WITHDIST], [WITHHASH], [COUNT count], [ASC|DESC], [STORE key], [STOREDIST key]); |
682
|
|
|
|
|
|
|
$db = $db->georadiusbymember($key, $member, $radius, $m|km|ft|mi, [WITHCOORD], [WITHDIST], [WITHHASH], [COUNT count], [ASC|DESC], [STORE key], [STOREDIST key], sub { my ($db, $err, $res) = @_ }); |
683
|
|
|
|
|
|
|
$promise = $db->georadiusbymember_p($key, $member, $radius, $m|km|ft|mi, [WITHCOORD], [WITHDIST], [WITHHASH], [COUNT count], [ASC|DESC], [STORE key], [STOREDIST key]); |
684
|
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
Query a sorted set representing a geospatial index to fetch members matching a given maximum distance from a member. |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
See L for more information. |
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
=head2 get |
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
$res = $db->get($key); |
692
|
|
|
|
|
|
|
$db = $db->get($key, sub { my ($db, $err, $res) = @_ }); |
693
|
|
|
|
|
|
|
$promise = $db->get_p($key); |
694
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
Get the value of a key. |
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
See L for more information. |
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
=head2 getbit |
700
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
$res = $db->getbit($key, $offset); |
702
|
|
|
|
|
|
|
$db = $db->getbit($key, $offset, sub { my ($db, $err, $res) = @_ }); |
703
|
|
|
|
|
|
|
$promise = $db->getbit_p($key, $offset); |
704
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
Returns the bit value at offset in the string value stored at key. |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
See L for more information. |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
=head2 getrange |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
$res = $db->getrange($key, $start, $end); |
712
|
|
|
|
|
|
|
$db = $db->getrange($key, $start, $end, sub { my ($db, $err, $res) = @_ }); |
713
|
|
|
|
|
|
|
$promise = $db->getrange_p($key, $start, $end); |
714
|
|
|
|
|
|
|
|
715
|
|
|
|
|
|
|
Get a substring of the string stored at a key. |
716
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
See L for more information. |
718
|
|
|
|
|
|
|
|
719
|
|
|
|
|
|
|
=head2 getset |
720
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
$res = $db->getset($key, $value); |
722
|
|
|
|
|
|
|
$db = $db->getset($key, $value, sub { my ($db, $err, $res) = @_ }); |
723
|
|
|
|
|
|
|
$promise = $db->getset_p($key, $value); |
724
|
|
|
|
|
|
|
|
725
|
|
|
|
|
|
|
Set the string value of a key and return its old value. |
726
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
See L for more information. |
728
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
=head2 hdel |
730
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
$res = $db->hdel($key, $field [field ...]); |
732
|
|
|
|
|
|
|
$db = $db->hdel($key, $field [field ...], sub { my ($db, $err, $res) = @_ }); |
733
|
|
|
|
|
|
|
$promise = $db->hdel_p($key, $field [field ...]); |
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
Delete one or more hash fields. |
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
See L for more information. |
738
|
|
|
|
|
|
|
|
739
|
|
|
|
|
|
|
=head2 hexists |
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
$res = $db->hexists($key, $field); |
742
|
|
|
|
|
|
|
$db = $db->hexists($key, $field, sub { my ($db, $err, $res) = @_ }); |
743
|
|
|
|
|
|
|
$promise = $db->hexists_p($key, $field); |
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
Determine if a hash field exists. |
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
See L for more information. |
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
=head2 hget |
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
$res = $db->hget($key, $field); |
752
|
|
|
|
|
|
|
$db = $db->hget($key, $field, sub { my ($db, $err, $res) = @_ }); |
753
|
|
|
|
|
|
|
$promise = $db->hget_p($key, $field); |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
Get the value of a hash field. |
756
|
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
See L for more information. |
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
=head2 hgetall |
760
|
|
|
|
|
|
|
|
761
|
|
|
|
|
|
|
$res = $db->hgetall($key); |
762
|
|
|
|
|
|
|
$db = $db->hgetall($key, sub { my ($db, $err, $res) = @_ }); |
763
|
|
|
|
|
|
|
$promise = $db->hgetall_p($key); |
764
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
Get all the fields and values in a hash. The returned value from Redis is |
766
|
|
|
|
|
|
|
automatically turned into a hash-ref for convenience. |
767
|
|
|
|
|
|
|
|
768
|
|
|
|
|
|
|
See L for more information. |
769
|
|
|
|
|
|
|
|
770
|
|
|
|
|
|
|
=head2 hincrby |
771
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
$res = $db->hincrby($key, $field, $increment); |
773
|
|
|
|
|
|
|
$db = $db->hincrby($key, $field, $increment, sub { my ($db, $err, $res) = @_ }); |
774
|
|
|
|
|
|
|
$promise = $db->hincrby_p($key, $field, $increment); |
775
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
Increment the integer value of a hash field by the given number. |
777
|
|
|
|
|
|
|
|
778
|
|
|
|
|
|
|
See L for more information. |
779
|
|
|
|
|
|
|
|
780
|
|
|
|
|
|
|
=head2 hincrbyfloat |
781
|
|
|
|
|
|
|
|
782
|
|
|
|
|
|
|
$res = $db->hincrbyfloat($key, $field, $increment); |
783
|
|
|
|
|
|
|
$db = $db->hincrbyfloat($key, $field, $increment, sub { my ($db, $err, $res) = @_ }); |
784
|
|
|
|
|
|
|
$promise = $db->hincrbyfloat_p($key, $field, $increment); |
785
|
|
|
|
|
|
|
|
786
|
|
|
|
|
|
|
Increment the float value of a hash field by the given amount. |
787
|
|
|
|
|
|
|
|
788
|
|
|
|
|
|
|
See L for more information. |
789
|
|
|
|
|
|
|
|
790
|
|
|
|
|
|
|
=head2 hkeys |
791
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
$res = $db->hkeys($key); |
793
|
|
|
|
|
|
|
$db = $db->hkeys($key, sub { my ($db, $err, $res) = @_ }); |
794
|
|
|
|
|
|
|
$promise = $db->hkeys_p($key); |
795
|
|
|
|
|
|
|
|
796
|
|
|
|
|
|
|
Get all the fields in a hash. |
797
|
|
|
|
|
|
|
|
798
|
|
|
|
|
|
|
See L for more information. |
799
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
=head2 hlen |
801
|
|
|
|
|
|
|
|
802
|
|
|
|
|
|
|
$res = $db->hlen($key); |
803
|
|
|
|
|
|
|
$db = $db->hlen($key, sub { my ($db, $err, $res) = @_ }); |
804
|
|
|
|
|
|
|
$promise = $db->hlen_p($key); |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
Get the number of fields in a hash. |
807
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
See L for more information. |
809
|
|
|
|
|
|
|
|
810
|
|
|
|
|
|
|
=head2 hmget |
811
|
|
|
|
|
|
|
|
812
|
|
|
|
|
|
|
$res = $db->hmget($key, $field [field ...]); |
813
|
|
|
|
|
|
|
$db = $db->hmget($key, $field [field ...], sub { my ($db, $err, $res) = @_ }); |
814
|
|
|
|
|
|
|
$promise = $db->hmget_p($key, $field [field ...]); |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
Get the values of all the given hash fields. |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
See L for more information. |
819
|
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
=head2 hmset |
821
|
|
|
|
|
|
|
|
822
|
|
|
|
|
|
|
$res = $db->hmset($key, $field => $value [field value ...]); |
823
|
|
|
|
|
|
|
$db = $db->hmset($key, $field => $value [field value ...], sub { my ($db, $err, $res) = @_ }); |
824
|
|
|
|
|
|
|
$promise = $db->hmset_p($key, $field => $value [field value ...]); |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
Set multiple hash fields to multiple values. |
827
|
|
|
|
|
|
|
|
828
|
|
|
|
|
|
|
See L for more information. |
829
|
|
|
|
|
|
|
|
830
|
|
|
|
|
|
|
=head2 hset |
831
|
|
|
|
|
|
|
|
832
|
|
|
|
|
|
|
$res = $db->hset($key, $field, $value); |
833
|
|
|
|
|
|
|
$db = $db->hset($key, $field, $value, sub { my ($db, $err, $res) = @_ }); |
834
|
|
|
|
|
|
|
$promise = $db->hset_p($key, $field, $value); |
835
|
|
|
|
|
|
|
|
836
|
|
|
|
|
|
|
Set the string value of a hash field. |
837
|
|
|
|
|
|
|
|
838
|
|
|
|
|
|
|
See L for more information. |
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
=head2 hsetnx |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
$res = $db->hsetnx($key, $field, $value); |
843
|
|
|
|
|
|
|
$db = $db->hsetnx($key, $field, $value, sub { my ($db, $err, $res) = @_ }); |
844
|
|
|
|
|
|
|
$promise = $db->hsetnx_p($key, $field, $value); |
845
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
Set the value of a hash field, only if the field does not exist. |
847
|
|
|
|
|
|
|
|
848
|
|
|
|
|
|
|
See L for more information. |
849
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
=head2 hstrlen |
851
|
|
|
|
|
|
|
|
852
|
|
|
|
|
|
|
$res = $db->hstrlen($key, $field); |
853
|
|
|
|
|
|
|
$db = $db->hstrlen($key, $field, sub { my ($db, $err, $res) = @_ }); |
854
|
|
|
|
|
|
|
$promise = $db->hstrlen_p($key, $field); |
855
|
|
|
|
|
|
|
|
856
|
|
|
|
|
|
|
Get the length of the value of a hash field. |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
See L for more information. |
859
|
|
|
|
|
|
|
|
860
|
|
|
|
|
|
|
=head2 hvals |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
$res = $db->hvals($key); |
863
|
|
|
|
|
|
|
$db = $db->hvals($key, sub { my ($db, $err, $res) = @_ }); |
864
|
|
|
|
|
|
|
$promise = $db->hvals_p($key); |
865
|
|
|
|
|
|
|
|
866
|
|
|
|
|
|
|
Get all the values in a hash. |
867
|
|
|
|
|
|
|
|
868
|
|
|
|
|
|
|
See L for more information. |
869
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
=head2 info |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
$res = $db->info($section); |
873
|
|
|
|
|
|
|
$db = $db->info($section, sub { my ($db, $err, $res) = @_ }); |
874
|
|
|
|
|
|
|
$promise = $db->info_p($section); |
875
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
Get information and statistics about the server. See also L. |
877
|
|
|
|
|
|
|
|
878
|
|
|
|
|
|
|
See L for more information. |
879
|
|
|
|
|
|
|
|
880
|
|
|
|
|
|
|
=head2 info_structured |
881
|
|
|
|
|
|
|
|
882
|
|
|
|
|
|
|
Same as L, but the result is a hash-ref where the keys are the different |
883
|
|
|
|
|
|
|
sections, with key/values in a sub hash. Will only be key/values if <$section> |
884
|
|
|
|
|
|
|
is specified. |
885
|
|
|
|
|
|
|
|
886
|
|
|
|
|
|
|
=head2 incr |
887
|
|
|
|
|
|
|
|
888
|
|
|
|
|
|
|
$res = $db->incr($key); |
889
|
|
|
|
|
|
|
$db = $db->incr($key, sub { my ($db, $err, $res) = @_ }); |
890
|
|
|
|
|
|
|
$promise = $db->incr_p($key); |
891
|
|
|
|
|
|
|
|
892
|
|
|
|
|
|
|
Increment the integer value of a key by one. |
893
|
|
|
|
|
|
|
|
894
|
|
|
|
|
|
|
See L for more information. |
895
|
|
|
|
|
|
|
|
896
|
|
|
|
|
|
|
=head2 incrby |
897
|
|
|
|
|
|
|
|
898
|
|
|
|
|
|
|
$res = $db->incrby($key, $increment); |
899
|
|
|
|
|
|
|
$db = $db->incrby($key, $increment, sub { my ($db, $err, $res) = @_ }); |
900
|
|
|
|
|
|
|
$promise = $db->incrby_p($key, $increment); |
901
|
|
|
|
|
|
|
|
902
|
|
|
|
|
|
|
Increment the integer value of a key by the given amount. |
903
|
|
|
|
|
|
|
|
904
|
|
|
|
|
|
|
See L for more information. |
905
|
|
|
|
|
|
|
|
906
|
|
|
|
|
|
|
=head2 incrbyfloat |
907
|
|
|
|
|
|
|
|
908
|
|
|
|
|
|
|
$res = $db->incrbyfloat($key, $increment); |
909
|
|
|
|
|
|
|
$db = $db->incrbyfloat($key, $increment, sub { my ($db, $err, $res) = @_ }); |
910
|
|
|
|
|
|
|
$promise = $db->incrbyfloat_p($key, $increment); |
911
|
|
|
|
|
|
|
|
912
|
|
|
|
|
|
|
Increment the float value of a key by the given amount. |
913
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
See L for more information. |
915
|
|
|
|
|
|
|
|
916
|
|
|
|
|
|
|
=head2 keys |
917
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
$res = $db->keys($pattern); |
919
|
|
|
|
|
|
|
$db = $db->keys($pattern, sub { my ($db, $err, $res) = @_ }); |
920
|
|
|
|
|
|
|
$promise = $db->keys_p($pattern); |
921
|
|
|
|
|
|
|
|
922
|
|
|
|
|
|
|
Find all keys matching the given pattern. |
923
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
See L for more information. |
925
|
|
|
|
|
|
|
|
926
|
|
|
|
|
|
|
=head2 lastsave |
927
|
|
|
|
|
|
|
|
928
|
|
|
|
|
|
|
$res = $db->lastsave; |
929
|
|
|
|
|
|
|
$db = $db->lastsave(sub { my ($db, $err, $res) = @_ }); |
930
|
|
|
|
|
|
|
$promise = $db->lastsave_p; |
931
|
|
|
|
|
|
|
|
932
|
|
|
|
|
|
|
Get the UNIX time stamp of the last successful save to disk. |
933
|
|
|
|
|
|
|
|
934
|
|
|
|
|
|
|
See L for more information. |
935
|
|
|
|
|
|
|
|
936
|
|
|
|
|
|
|
=head2 lindex |
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
$res = $db->lindex($key, $index); |
939
|
|
|
|
|
|
|
$db = $db->lindex($key, $index, sub { my ($db, $err, $res) = @_ }); |
940
|
|
|
|
|
|
|
$promise = $db->lindex_p($key, $index); |
941
|
|
|
|
|
|
|
|
942
|
|
|
|
|
|
|
Get an element from a list by its index. |
943
|
|
|
|
|
|
|
|
944
|
|
|
|
|
|
|
See L for more information. |
945
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
=head2 linsert |
947
|
|
|
|
|
|
|
|
948
|
|
|
|
|
|
|
$res = $db->linsert($key, $BEFORE|AFTER, $pivot, $value); |
949
|
|
|
|
|
|
|
$db = $db->linsert($key, $BEFORE|AFTER, $pivot, $value, sub { my ($db, $err, $res) = @_ }); |
950
|
|
|
|
|
|
|
$promise = $db->linsert_p($key, $BEFORE|AFTER, $pivot, $value); |
951
|
|
|
|
|
|
|
|
952
|
|
|
|
|
|
|
Insert an element before or after another element in a list. |
953
|
|
|
|
|
|
|
|
954
|
|
|
|
|
|
|
See L for more information. |
955
|
|
|
|
|
|
|
|
956
|
|
|
|
|
|
|
=head2 llen |
957
|
|
|
|
|
|
|
|
958
|
|
|
|
|
|
|
$res = $db->llen($key); |
959
|
|
|
|
|
|
|
$db = $db->llen($key, sub { my ($db, $err, $res) = @_ }); |
960
|
|
|
|
|
|
|
$promise = $db->llen_p($key); |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
Get the length of a list. |
963
|
|
|
|
|
|
|
|
964
|
|
|
|
|
|
|
See L for more information. |
965
|
|
|
|
|
|
|
|
966
|
|
|
|
|
|
|
=head2 lpop |
967
|
|
|
|
|
|
|
|
968
|
|
|
|
|
|
|
$res = $db->lpop($key); |
969
|
|
|
|
|
|
|
$db = $db->lpop($key, sub { my ($db, $err, $res) = @_ }); |
970
|
|
|
|
|
|
|
$promise = $db->lpop_p($key); |
971
|
|
|
|
|
|
|
|
972
|
|
|
|
|
|
|
Remove and get the first element in a list. |
973
|
|
|
|
|
|
|
|
974
|
|
|
|
|
|
|
See L for more information. |
975
|
|
|
|
|
|
|
|
976
|
|
|
|
|
|
|
=head2 lpush |
977
|
|
|
|
|
|
|
|
978
|
|
|
|
|
|
|
$res = $db->lpush($key, $value [value ...]); |
979
|
|
|
|
|
|
|
$db = $db->lpush($key, $value [value ...], sub { my ($db, $err, $res) = @_ }); |
980
|
|
|
|
|
|
|
$promise = $db->lpush_p($key, $value [value ...]); |
981
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
Prepend one or multiple values to a list. |
983
|
|
|
|
|
|
|
|
984
|
|
|
|
|
|
|
See L for more information. |
985
|
|
|
|
|
|
|
|
986
|
|
|
|
|
|
|
=head2 lpushx |
987
|
|
|
|
|
|
|
|
988
|
|
|
|
|
|
|
$res = $db->lpushx($key, $value); |
989
|
|
|
|
|
|
|
$db = $db->lpushx($key, $value, sub { my ($db, $err, $res) = @_ }); |
990
|
|
|
|
|
|
|
$promise = $db->lpushx_p($key, $value); |
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
Prepend a value to a list, only if the list exists. |
993
|
|
|
|
|
|
|
|
994
|
|
|
|
|
|
|
See L for more information. |
995
|
|
|
|
|
|
|
|
996
|
|
|
|
|
|
|
=head2 lrange |
997
|
|
|
|
|
|
|
|
998
|
|
|
|
|
|
|
$res = $db->lrange($key, $start, $stop); |
999
|
|
|
|
|
|
|
$db = $db->lrange($key, $start, $stop, sub { my ($db, $err, $res) = @_ }); |
1000
|
|
|
|
|
|
|
$promise = $db->lrange_p($key, $start, $stop); |
1001
|
|
|
|
|
|
|
|
1002
|
|
|
|
|
|
|
Get a range of elements from a list. |
1003
|
|
|
|
|
|
|
|
1004
|
|
|
|
|
|
|
See L for more information. |
1005
|
|
|
|
|
|
|
|
1006
|
|
|
|
|
|
|
=head2 lrem |
1007
|
|
|
|
|
|
|
|
1008
|
|
|
|
|
|
|
$res = $db->lrem($key, $count, $value); |
1009
|
|
|
|
|
|
|
$db = $db->lrem($key, $count, $value, sub { my ($db, $err, $res) = @_ }); |
1010
|
|
|
|
|
|
|
$promise = $db->lrem_p($key, $count, $value); |
1011
|
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
|
Remove elements from a list. |
1013
|
|
|
|
|
|
|
|
1014
|
|
|
|
|
|
|
See L for more information. |
1015
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
=head2 lset |
1017
|
|
|
|
|
|
|
|
1018
|
|
|
|
|
|
|
$res = $db->lset($key, $index, $value); |
1019
|
|
|
|
|
|
|
$db = $db->lset($key, $index, $value, sub { my ($db, $err, $res) = @_ }); |
1020
|
|
|
|
|
|
|
$promise = $db->lset_p($key, $index, $value); |
1021
|
|
|
|
|
|
|
|
1022
|
|
|
|
|
|
|
Set the value of an element in a list by its index. |
1023
|
|
|
|
|
|
|
|
1024
|
|
|
|
|
|
|
See L for more information. |
1025
|
|
|
|
|
|
|
|
1026
|
|
|
|
|
|
|
=head2 ltrim |
1027
|
|
|
|
|
|
|
|
1028
|
|
|
|
|
|
|
$res = $db->ltrim($key, $start, $stop); |
1029
|
|
|
|
|
|
|
$db = $db->ltrim($key, $start, $stop, sub { my ($db, $err, $res) = @_ }); |
1030
|
|
|
|
|
|
|
$promise = $db->ltrim_p($key, $start, $stop); |
1031
|
|
|
|
|
|
|
|
1032
|
|
|
|
|
|
|
Trim a list to the specified range. |
1033
|
|
|
|
|
|
|
|
1034
|
|
|
|
|
|
|
See L for more information. |
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
=head2 mget |
1037
|
|
|
|
|
|
|
|
1038
|
|
|
|
|
|
|
$res = $db->mget($key [key ...]); |
1039
|
|
|
|
|
|
|
$db = $db->mget($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1040
|
|
|
|
|
|
|
$promise = $db->mget_p($key [key ...]); |
1041
|
|
|
|
|
|
|
|
1042
|
|
|
|
|
|
|
Get the values of all the given keys. |
1043
|
|
|
|
|
|
|
|
1044
|
|
|
|
|
|
|
See L for more information. |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
=head2 move |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
$res = $db->move($key, $db); |
1049
|
|
|
|
|
|
|
$db = $db->move($key, $db, sub { my ($db, $err, $res) = @_ }); |
1050
|
|
|
|
|
|
|
$promise = $db->move_p($key, $db); |
1051
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
Move a key to another database. |
1053
|
|
|
|
|
|
|
|
1054
|
|
|
|
|
|
|
See L for more information. |
1055
|
|
|
|
|
|
|
|
1056
|
|
|
|
|
|
|
=head2 mset |
1057
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
$res = $db->mset($key value [key value ...]); |
1059
|
|
|
|
|
|
|
$db = $db->mset($key value [key value ...], sub { my ($db, $err, $res) = @_ }); |
1060
|
|
|
|
|
|
|
$promise = $db->mset_p($key value [key value ...]); |
1061
|
|
|
|
|
|
|
|
1062
|
|
|
|
|
|
|
Set multiple keys to multiple values. |
1063
|
|
|
|
|
|
|
|
1064
|
|
|
|
|
|
|
See L for more information. |
1065
|
|
|
|
|
|
|
|
1066
|
|
|
|
|
|
|
=head2 msetnx |
1067
|
|
|
|
|
|
|
|
1068
|
|
|
|
|
|
|
$res = $db->msetnx($key value [key value ...]); |
1069
|
|
|
|
|
|
|
$db = $db->msetnx($key value [key value ...], sub { my ($db, $err, $res) = @_ }); |
1070
|
|
|
|
|
|
|
$promise = $db->msetnx_p($key value [key value ...]); |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
Set multiple keys to multiple values, only if none of the keys exist. |
1073
|
|
|
|
|
|
|
|
1074
|
|
|
|
|
|
|
See L for more information. |
1075
|
|
|
|
|
|
|
|
1076
|
|
|
|
|
|
|
=head2 multi |
1077
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
See L. |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
=head2 multi_p |
1081
|
|
|
|
|
|
|
|
1082
|
|
|
|
|
|
|
$res = $db->multi; |
1083
|
|
|
|
|
|
|
$db = $db->multi(sub { my ($db, $err, $res) = @_ }); |
1084
|
|
|
|
|
|
|
$promise = $db->multi_p; |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
Mark the start of a transaction block. Commands issued after L will |
1087
|
|
|
|
|
|
|
automatically be discarded if C<$db> goes out of scope. Need to call |
1088
|
|
|
|
|
|
|
L to commit the queued commands to Redis. |
1089
|
|
|
|
|
|
|
|
1090
|
|
|
|
|
|
|
NOTE: the previously supported C syntax has been removed, |
1091
|
|
|
|
|
|
|
because it did not work as expected. See |
1092
|
|
|
|
|
|
|
L for details. |
1093
|
|
|
|
|
|
|
When L gets called with non-zero arguments, it Cs. |
1094
|
|
|
|
|
|
|
Use the promise chaining instead: |
1095
|
|
|
|
|
|
|
|
1096
|
|
|
|
|
|
|
$db->multi_p->then(sub { |
1097
|
|
|
|
|
|
|
Mojo::Promise->all( |
1098
|
|
|
|
|
|
|
$db->set_p(...), |
1099
|
|
|
|
|
|
|
$db->incr_p(...), |
1100
|
|
|
|
|
|
|
... |
1101
|
|
|
|
|
|
|
); |
1102
|
|
|
|
|
|
|
})->then(sub { |
1103
|
|
|
|
|
|
|
$db->exec_p; |
1104
|
|
|
|
|
|
|
})->then ... |
1105
|
|
|
|
|
|
|
|
1106
|
|
|
|
|
|
|
See L for more information. |
1107
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
=head2 object |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
$res = $db->object($subcommand, [arguments [arguments ...]]); |
1111
|
|
|
|
|
|
|
$db = $db->object($subcommand, [arguments [arguments ...]], sub { my ($db, $err, $res) =@_ }); |
1112
|
|
|
|
|
|
|
$promise = $db->object_p($subcommand, [arguments [arguments ...]]); |
1113
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
Inspect the internals of Redis objects. |
1115
|
|
|
|
|
|
|
|
1116
|
|
|
|
|
|
|
See L for more information. |
1117
|
|
|
|
|
|
|
|
1118
|
|
|
|
|
|
|
=head2 persist |
1119
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
$res = $db->persist($key); |
1121
|
|
|
|
|
|
|
$db = $db->persist($key, sub { my ($db, $err, $res) = @_ }); |
1122
|
|
|
|
|
|
|
$promise = $db->persist_p($key); |
1123
|
|
|
|
|
|
|
|
1124
|
|
|
|
|
|
|
Remove the expiration from a key. |
1125
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
See L for more information. |
1127
|
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
|
=head2 pexpire |
1129
|
|
|
|
|
|
|
|
1130
|
|
|
|
|
|
|
$res = $db->pexpire($key, $milliseconds); |
1131
|
|
|
|
|
|
|
$db = $db->pexpire($key, $milliseconds, sub { my ($db, $err, $res) = @_ }); |
1132
|
|
|
|
|
|
|
$promise = $db->pexpire_p($key, $milliseconds); |
1133
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
Set a key's time to live in milliseconds. |
1135
|
|
|
|
|
|
|
|
1136
|
|
|
|
|
|
|
See L for more information. |
1137
|
|
|
|
|
|
|
|
1138
|
|
|
|
|
|
|
=head2 pexpireat |
1139
|
|
|
|
|
|
|
|
1140
|
|
|
|
|
|
|
$res = $db->pexpireat($key, $milliseconds-timestamp); |
1141
|
|
|
|
|
|
|
$db = $db->pexpireat($key, $milliseconds-timestamp, sub { my ($db, $err, $res) = @_ }); |
1142
|
|
|
|
|
|
|
$promise = $db->pexpireat_p($key, $milliseconds-timestamp); |
1143
|
|
|
|
|
|
|
|
1144
|
|
|
|
|
|
|
Set the expiration for a key as a UNIX timestamp specified in milliseconds. |
1145
|
|
|
|
|
|
|
|
1146
|
|
|
|
|
|
|
See L for more information. |
1147
|
|
|
|
|
|
|
|
1148
|
|
|
|
|
|
|
=head2 pfadd |
1149
|
|
|
|
|
|
|
|
1150
|
|
|
|
|
|
|
$res = $db->pfadd($key, $element [element ...]); |
1151
|
|
|
|
|
|
|
$db = $db->pfadd($key, $element [element ...], sub { my ($db, $err, $res) = @_ }); |
1152
|
|
|
|
|
|
|
$promise = $db->pfadd_p($key, $element [element ...]); |
1153
|
|
|
|
|
|
|
|
1154
|
|
|
|
|
|
|
Adds the specified elements to the specified HyperLogLog. |
1155
|
|
|
|
|
|
|
|
1156
|
|
|
|
|
|
|
See L for more information. |
1157
|
|
|
|
|
|
|
|
1158
|
|
|
|
|
|
|
=head2 pfcount |
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
$res = $db->pfcount($key [key ...]); |
1161
|
|
|
|
|
|
|
$db = $db->pfcount($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1162
|
|
|
|
|
|
|
$promise = $db->pfcount_p($key [key ...]); |
1163
|
|
|
|
|
|
|
|
1164
|
|
|
|
|
|
|
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s). |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
See L for more information. |
1167
|
|
|
|
|
|
|
|
1168
|
|
|
|
|
|
|
=head2 pfmerge |
1169
|
|
|
|
|
|
|
|
1170
|
|
|
|
|
|
|
$res = $db->pfmerge($destkey, $sourcekey [sourcekey ...]); |
1171
|
|
|
|
|
|
|
$db = $db->pfmerge($destkey, $sourcekey [sourcekey ...], sub { my ($db, $err, $res) = @_}); |
1172
|
|
|
|
|
|
|
$promise = $db->pfmerge_p($destkey, $sourcekey [sourcekey ...]); |
1173
|
|
|
|
|
|
|
|
1174
|
|
|
|
|
|
|
Merge N different HyperLogLogs into a single one. |
1175
|
|
|
|
|
|
|
|
1176
|
|
|
|
|
|
|
See L for more information. |
1177
|
|
|
|
|
|
|
|
1178
|
|
|
|
|
|
|
=head2 ping |
1179
|
|
|
|
|
|
|
|
1180
|
|
|
|
|
|
|
$res = $db->ping([message]); |
1181
|
|
|
|
|
|
|
$db = $db->ping([message], sub { my ($db, $err, $res) = @_ }); |
1182
|
|
|
|
|
|
|
$promise = $db->ping_p([message]); |
1183
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
Ping the server. |
1185
|
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
|
See L for more information. |
1187
|
|
|
|
|
|
|
|
1188
|
|
|
|
|
|
|
=head2 psetex |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
$res = $db->psetex($key, $milliseconds, $value); |
1191
|
|
|
|
|
|
|
$db = $db->psetex($key, $milliseconds, $value, sub { my ($db, $err, $res) = @_ }); |
1192
|
|
|
|
|
|
|
$promise = $db->psetex_p($key, $milliseconds, $value); |
1193
|
|
|
|
|
|
|
|
1194
|
|
|
|
|
|
|
Set the value and expiration in milliseconds of a key. |
1195
|
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
|
See L for more information. |
1197
|
|
|
|
|
|
|
|
1198
|
|
|
|
|
|
|
=head2 pttl |
1199
|
|
|
|
|
|
|
|
1200
|
|
|
|
|
|
|
$res = $db->pttl($key); |
1201
|
|
|
|
|
|
|
$db = $db->pttl($key, sub { my ($db, $err, $res) = @_ }); |
1202
|
|
|
|
|
|
|
$promise = $db->pttl_p($key); |
1203
|
|
|
|
|
|
|
|
1204
|
|
|
|
|
|
|
Get the time to live for a key in milliseconds. |
1205
|
|
|
|
|
|
|
|
1206
|
|
|
|
|
|
|
See L for more information. |
1207
|
|
|
|
|
|
|
|
1208
|
|
|
|
|
|
|
=head2 publish |
1209
|
|
|
|
|
|
|
|
1210
|
|
|
|
|
|
|
$res = $db->publish($channel, $message); |
1211
|
|
|
|
|
|
|
$db = $db->publish($channel, $message, sub { my ($db, $err, $res) = @_ }); |
1212
|
|
|
|
|
|
|
$promise = $db->publish_p($channel, $message); |
1213
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
Post a message to a channel. |
1215
|
|
|
|
|
|
|
|
1216
|
|
|
|
|
|
|
See L for more information. |
1217
|
|
|
|
|
|
|
|
1218
|
|
|
|
|
|
|
=head2 randomkey |
1219
|
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
|
$res = $db->randomkey; |
1221
|
|
|
|
|
|
|
$db = $db->randomkey(sub { my ($db, $err, $res) = @_ }); |
1222
|
|
|
|
|
|
|
$promise = $db->randomkey_p; |
1223
|
|
|
|
|
|
|
|
1224
|
|
|
|
|
|
|
Return a random key from the keyspace. |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
See L for more information. |
1227
|
|
|
|
|
|
|
|
1228
|
|
|
|
|
|
|
=head2 readonly |
1229
|
|
|
|
|
|
|
|
1230
|
|
|
|
|
|
|
$res = $db->readonly(); |
1231
|
|
|
|
|
|
|
$db = $db->readonly(, sub { my ($db, $res) = @_ }); |
1232
|
|
|
|
|
|
|
$promise = $db->readonly_p(); |
1233
|
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
Enables read queries for a connection to a cluster slave node. |
1235
|
|
|
|
|
|
|
|
1236
|
|
|
|
|
|
|
See L for more information. |
1237
|
|
|
|
|
|
|
|
1238
|
|
|
|
|
|
|
=head2 readwrite |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
$res = $db->readwrite(); |
1241
|
|
|
|
|
|
|
$db = $db->readwrite(, sub { my ($db, $res) = @_ }); |
1242
|
|
|
|
|
|
|
$promise = $db->readwrite_p(); |
1243
|
|
|
|
|
|
|
|
1244
|
|
|
|
|
|
|
Disables read queries for a connection to a cluster slave node. |
1245
|
|
|
|
|
|
|
|
1246
|
|
|
|
|
|
|
See L for more information. |
1247
|
|
|
|
|
|
|
|
1248
|
|
|
|
|
|
|
=head2 rename |
1249
|
|
|
|
|
|
|
|
1250
|
|
|
|
|
|
|
$res = $db->rename($key, $newkey); |
1251
|
|
|
|
|
|
|
$db = $db->rename($key, $newkey, sub { my ($db, $err, $res) = @_ }); |
1252
|
|
|
|
|
|
|
$promise = $db->rename_p($key, $newkey); |
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
Rename a key. |
1255
|
|
|
|
|
|
|
|
1256
|
|
|
|
|
|
|
See L for more information. |
1257
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
=head2 renamenx |
1259
|
|
|
|
|
|
|
|
1260
|
|
|
|
|
|
|
$res = $db->renamenx($key, $newkey); |
1261
|
|
|
|
|
|
|
$db = $db->renamenx($key, $newkey, sub { my ($db, $err, $res) = @_ }); |
1262
|
|
|
|
|
|
|
$promise = $db->renamenx_p($key, $newkey); |
1263
|
|
|
|
|
|
|
|
1264
|
|
|
|
|
|
|
Rename a key, only if the new key does not exist. |
1265
|
|
|
|
|
|
|
|
1266
|
|
|
|
|
|
|
See L for more information. |
1267
|
|
|
|
|
|
|
|
1268
|
|
|
|
|
|
|
=head2 role |
1269
|
|
|
|
|
|
|
|
1270
|
|
|
|
|
|
|
$res = $db->role; |
1271
|
|
|
|
|
|
|
$db = $db->role(sub { my ($db, $err, $res) = @_ }); |
1272
|
|
|
|
|
|
|
$promise = $db->role_p; |
1273
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
Return the role of the instance in the context of replication. |
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
See L for more information. |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
=head2 rpop |
1279
|
|
|
|
|
|
|
|
1280
|
|
|
|
|
|
|
$res = $db->rpop($key); |
1281
|
|
|
|
|
|
|
$db = $db->rpop($key, sub { my ($db, $err, $res) = @_ }); |
1282
|
|
|
|
|
|
|
$promise = $db->rpop_p($key); |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
Remove and get the last element in a list. |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
See L for more information. |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
=head2 rpoplpush |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
$res = $db->rpoplpush($source, $destination); |
1291
|
|
|
|
|
|
|
$db = $db->rpoplpush($source, $destination, sub { my ($db, $err, $res) = @_ }); |
1292
|
|
|
|
|
|
|
$promise = $db->rpoplpush_p($source, $destination); |
1293
|
|
|
|
|
|
|
|
1294
|
|
|
|
|
|
|
Remove the last element in a list, prepend it to another list and return it. |
1295
|
|
|
|
|
|
|
|
1296
|
|
|
|
|
|
|
See L for more information. |
1297
|
|
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
=head2 rpush |
1299
|
|
|
|
|
|
|
|
1300
|
|
|
|
|
|
|
$res = $db->rpush($key, $value [value ...]); |
1301
|
|
|
|
|
|
|
$db = $db->rpush($key, $value [value ...], sub { my ($db, $err, $res) = @_ }); |
1302
|
|
|
|
|
|
|
$promise = $db->rpush_p($key, $value [value ...]); |
1303
|
|
|
|
|
|
|
|
1304
|
|
|
|
|
|
|
Append one or multiple values to a list. |
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
See L for more information. |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
=head2 rpushx |
1309
|
|
|
|
|
|
|
|
1310
|
|
|
|
|
|
|
$res = $db->rpushx($key, $value); |
1311
|
|
|
|
|
|
|
$db = $db->rpushx($key, $value, sub { my ($db, $err, $res) = @_ }); |
1312
|
|
|
|
|
|
|
$promise = $db->rpushx_p($key, $value); |
1313
|
|
|
|
|
|
|
|
1314
|
|
|
|
|
|
|
Append a value to a list, only if the list exists. |
1315
|
|
|
|
|
|
|
|
1316
|
|
|
|
|
|
|
See L for more information. |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
=head2 restore |
1319
|
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
|
$res = $db->restore($key, $ttl, $serialized-value, [REPLACE]); |
1321
|
|
|
|
|
|
|
$db = $db->restore($key, $ttl, $serialized-value, [REPLACE], sub { my ($db, $err, $res) = @_ }); |
1322
|
|
|
|
|
|
|
$promise = $db->restore_p($key, $ttl, $serialized-value, [REPLACE]); |
1323
|
|
|
|
|
|
|
|
1324
|
|
|
|
|
|
|
Create a key using the provided serialized value, previously obtained using DUMP. |
1325
|
|
|
|
|
|
|
|
1326
|
|
|
|
|
|
|
See L for more information. |
1327
|
|
|
|
|
|
|
|
1328
|
|
|
|
|
|
|
=head2 sadd |
1329
|
|
|
|
|
|
|
|
1330
|
|
|
|
|
|
|
$res = $db->sadd($key, $member [member ...]); |
1331
|
|
|
|
|
|
|
$db = $db->sadd($key, $member [member ...], sub { my ($db, $err, $res) = @_ }); |
1332
|
|
|
|
|
|
|
$promise = $db->sadd_p($key, $member [member ...]); |
1333
|
|
|
|
|
|
|
|
1334
|
|
|
|
|
|
|
Add one or more members to a set. |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
See L for more information. |
1337
|
|
|
|
|
|
|
|
1338
|
|
|
|
|
|
|
=head2 save |
1339
|
|
|
|
|
|
|
|
1340
|
|
|
|
|
|
|
$res = $db->save; |
1341
|
|
|
|
|
|
|
$db = $db->save(sub { my ($db, $err, $res) = @_ }); |
1342
|
|
|
|
|
|
|
$promise = $db->save_p; |
1343
|
|
|
|
|
|
|
|
1344
|
|
|
|
|
|
|
Synchronously save the dataset to disk. |
1345
|
|
|
|
|
|
|
|
1346
|
|
|
|
|
|
|
See L for more information. |
1347
|
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
=head2 scard |
1349
|
|
|
|
|
|
|
|
1350
|
|
|
|
|
|
|
$res = $db->scard($key); |
1351
|
|
|
|
|
|
|
$db = $db->scard($key, sub { my ($db, $err, $res) = @_ }); |
1352
|
|
|
|
|
|
|
$promise = $db->scard_p($key); |
1353
|
|
|
|
|
|
|
|
1354
|
|
|
|
|
|
|
Get the number of members in a set. |
1355
|
|
|
|
|
|
|
|
1356
|
|
|
|
|
|
|
See L for more information. |
1357
|
|
|
|
|
|
|
|
1358
|
|
|
|
|
|
|
=head2 script |
1359
|
|
|
|
|
|
|
|
1360
|
|
|
|
|
|
|
$res = $db->script($sub_command, @args); |
1361
|
|
|
|
|
|
|
$db = $db->script($sub_command, @args, sub { my ($db, $err, $res) = @_ }); |
1362
|
|
|
|
|
|
|
$promise = $db->script_p($sub_command, @args); |
1363
|
|
|
|
|
|
|
|
1364
|
|
|
|
|
|
|
Execute a script command. |
1365
|
|
|
|
|
|
|
|
1366
|
|
|
|
|
|
|
See L, |
1367
|
|
|
|
|
|
|
L, |
1368
|
|
|
|
|
|
|
L, |
1369
|
|
|
|
|
|
|
L or |
1370
|
|
|
|
|
|
|
L for more information. |
1371
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
=head2 sdiff |
1373
|
|
|
|
|
|
|
|
1374
|
|
|
|
|
|
|
$res = $db->sdiff($key [key ...]); |
1375
|
|
|
|
|
|
|
$db = $db->sdiff($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1376
|
|
|
|
|
|
|
$promise = $db->sdiff_p($key [key ...]); |
1377
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
Subtract multiple sets. |
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
See L for more information. |
1381
|
|
|
|
|
|
|
|
1382
|
|
|
|
|
|
|
=head2 sdiffstore |
1383
|
|
|
|
|
|
|
|
1384
|
|
|
|
|
|
|
$res = $db->sdiffstore($destination, $key [key ...]); |
1385
|
|
|
|
|
|
|
$db = $db->sdiffstore($destination, $key [key ...], sub { my ($db, $err, $res) = @_ }); |
1386
|
|
|
|
|
|
|
$promise = $db->sdiffstore_p($destination, $key [key ...]); |
1387
|
|
|
|
|
|
|
|
1388
|
|
|
|
|
|
|
Subtract multiple sets and store the resulting set in a key. |
1389
|
|
|
|
|
|
|
|
1390
|
|
|
|
|
|
|
See L for more information. |
1391
|
|
|
|
|
|
|
|
1392
|
|
|
|
|
|
|
=head2 set |
1393
|
|
|
|
|
|
|
|
1394
|
|
|
|
|
|
|
$res = $db->set($key, $value, [expiration EX seconds|PX milliseconds], [NX|XX]); |
1395
|
|
|
|
|
|
|
$db = $db->set($key, $value, [expiration EX seconds|PX milliseconds], [NX|XX], sub {my ($db, $err, $res) = @_ }); |
1396
|
|
|
|
|
|
|
$promise = $db->set_p($key, $value, [expiration EX seconds|PX milliseconds], [NX|XX]); |
1397
|
|
|
|
|
|
|
|
1398
|
|
|
|
|
|
|
Set the string value of a key. |
1399
|
|
|
|
|
|
|
|
1400
|
|
|
|
|
|
|
See L for more information. |
1401
|
|
|
|
|
|
|
|
1402
|
|
|
|
|
|
|
=head2 setbit |
1403
|
|
|
|
|
|
|
|
1404
|
|
|
|
|
|
|
$res = $db->setbit($key, $offset, $value); |
1405
|
|
|
|
|
|
|
$db = $db->setbit($key, $offset, $value, sub { my ($db, $err, $res) = @_ }); |
1406
|
|
|
|
|
|
|
$promise = $db->setbit_p($key, $offset, $value); |
1407
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
Sets or clears the bit at offset in the string value stored at key. |
1409
|
|
|
|
|
|
|
|
1410
|
|
|
|
|
|
|
See L for more information. |
1411
|
|
|
|
|
|
|
|
1412
|
|
|
|
|
|
|
=head2 setex |
1413
|
|
|
|
|
|
|
|
1414
|
|
|
|
|
|
|
$res = $db->setex($key, $seconds, $value); |
1415
|
|
|
|
|
|
|
$db = $db->setex($key, $seconds, $value, sub { my ($db, $err, $res) = @_ }); |
1416
|
|
|
|
|
|
|
$promise = $db->setex_p($key, $seconds, $value); |
1417
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
Set the value and expiration of a key. |
1419
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
See L for more information. |
1421
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
=head2 setnx |
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
$res = $db->setnx($key, $value); |
1425
|
|
|
|
|
|
|
$db = $db->setnx($key, $value, sub { my ($db, $err, $res) = @_ }); |
1426
|
|
|
|
|
|
|
$promise = $db->setnx_p($key, $value); |
1427
|
|
|
|
|
|
|
|
1428
|
|
|
|
|
|
|
Set the value of a key, only if the key does not exist. |
1429
|
|
|
|
|
|
|
|
1430
|
|
|
|
|
|
|
See L for more information. |
1431
|
|
|
|
|
|
|
|
1432
|
|
|
|
|
|
|
=head2 setrange |
1433
|
|
|
|
|
|
|
|
1434
|
|
|
|
|
|
|
$res = $db->setrange($key, $offset, $value); |
1435
|
|
|
|
|
|
|
$db = $db->setrange($key, $offset, $value, sub { my ($db, $err, $res) = @_ }); |
1436
|
|
|
|
|
|
|
$promise = $db->setrange_p($key, $offset, $value); |
1437
|
|
|
|
|
|
|
|
1438
|
|
|
|
|
|
|
Overwrite part of a string at key starting at the specified offset. |
1439
|
|
|
|
|
|
|
|
1440
|
|
|
|
|
|
|
See L for more information. |
1441
|
|
|
|
|
|
|
|
1442
|
|
|
|
|
|
|
=head2 sinter |
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
$res = $db->sinter($key [key ...]); |
1445
|
|
|
|
|
|
|
$db = $db->sinter($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1446
|
|
|
|
|
|
|
$promise = $db->sinter_p($key [key ...]); |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
Intersect multiple sets. |
1449
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
See L for more information. |
1451
|
|
|
|
|
|
|
|
1452
|
|
|
|
|
|
|
=head2 sinterstore |
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
$res = $db->sinterstore($destination, $key [key ...]); |
1455
|
|
|
|
|
|
|
$db = $db->sinterstore($destination, $key [key ...], sub { my ($db, $err, $res) = @_ }); |
1456
|
|
|
|
|
|
|
$promise = $db->sinterstore_p($destination, $key [key ...]); |
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
Intersect multiple sets and store the resulting set in a key. |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
See L for more information. |
1461
|
|
|
|
|
|
|
|
1462
|
|
|
|
|
|
|
=head2 sismember |
1463
|
|
|
|
|
|
|
|
1464
|
|
|
|
|
|
|
$res = $db->sismember($key, $member); |
1465
|
|
|
|
|
|
|
$db = $db->sismember($key, $member, sub { my ($db, $err, $res) = @_ }); |
1466
|
|
|
|
|
|
|
$promise = $db->sismember_p($key, $member); |
1467
|
|
|
|
|
|
|
|
1468
|
|
|
|
|
|
|
Determine if a given value is a member of a set. |
1469
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
See L for more information. |
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
=head2 slaveof |
1473
|
|
|
|
|
|
|
|
1474
|
|
|
|
|
|
|
$res = $db->slaveof($host, $port); |
1475
|
|
|
|
|
|
|
$db = $db->slaveof($host, $port, sub { my ($db, $err, $res) = @_ }); |
1476
|
|
|
|
|
|
|
$promise = $db->slaveof_p($host, $port); |
1477
|
|
|
|
|
|
|
|
1478
|
|
|
|
|
|
|
Make the server a slave of another instance, or promote it as master. |
1479
|
|
|
|
|
|
|
|
1480
|
|
|
|
|
|
|
See L for more information. |
1481
|
|
|
|
|
|
|
|
1482
|
|
|
|
|
|
|
=head2 slowlog |
1483
|
|
|
|
|
|
|
|
1484
|
|
|
|
|
|
|
$res = $db->slowlog($subcommand, [argument]); |
1485
|
|
|
|
|
|
|
$db = $db->slowlog($subcommand, [argument], sub { my ($db, $err, $res) = @_ }); |
1486
|
|
|
|
|
|
|
$promise = $db->slowlog_p($subcommand, [argument]); |
1487
|
|
|
|
|
|
|
|
1488
|
|
|
|
|
|
|
Manages the Redis slow queries log. |
1489
|
|
|
|
|
|
|
|
1490
|
|
|
|
|
|
|
See L for more information. |
1491
|
|
|
|
|
|
|
|
1492
|
|
|
|
|
|
|
=head2 smembers |
1493
|
|
|
|
|
|
|
|
1494
|
|
|
|
|
|
|
$res = $db->smembers($key); |
1495
|
|
|
|
|
|
|
$db = $db->smembers($key, sub { my ($db, $err, $res) = @_ }); |
1496
|
|
|
|
|
|
|
$promise = $db->smembers_p($key); |
1497
|
|
|
|
|
|
|
|
1498
|
|
|
|
|
|
|
Get all the members in a set. |
1499
|
|
|
|
|
|
|
|
1500
|
|
|
|
|
|
|
See L for more information. |
1501
|
|
|
|
|
|
|
|
1502
|
|
|
|
|
|
|
=head2 smove |
1503
|
|
|
|
|
|
|
|
1504
|
|
|
|
|
|
|
$res = $db->smove($source, $destination, $member); |
1505
|
|
|
|
|
|
|
$db = $db->smove($source, $destination, $member, sub { my ($db, $err, $res) = @_ }); |
1506
|
|
|
|
|
|
|
$promise = $db->smove_p($source, $destination, $member); |
1507
|
|
|
|
|
|
|
|
1508
|
|
|
|
|
|
|
Move a member from one set to another. |
1509
|
|
|
|
|
|
|
|
1510
|
|
|
|
|
|
|
See L for more information. |
1511
|
|
|
|
|
|
|
|
1512
|
|
|
|
|
|
|
=head2 sort |
1513
|
|
|
|
|
|
|
|
1514
|
|
|
|
|
|
|
$res = $db->sort($key, [BY pattern], [LIMIT offset count], [GET pattern [GET pattern ...]], [ASC|DESC], [ALPHA], [STORE destination]); |
1515
|
|
|
|
|
|
|
$db = $db->sort($key, [BY pattern], [LIMIT offset count], [GET pattern [GET pattern ...]], [ASC|DESC], [ALPHA], [STORE destination], sub { my ($db, $err, $res) = @_ }); |
1516
|
|
|
|
|
|
|
$promise = $db->sort_p($key, [BY pattern], [LIMIT offset count], [GET pattern [GET pattern ...]], [ASC|DESC], [ALPHA], [STORE destination]); |
1517
|
|
|
|
|
|
|
|
1518
|
|
|
|
|
|
|
Sort the elements in a list, set or sorted set. |
1519
|
|
|
|
|
|
|
|
1520
|
|
|
|
|
|
|
See L for more information. |
1521
|
|
|
|
|
|
|
|
1522
|
|
|
|
|
|
|
=head2 spop |
1523
|
|
|
|
|
|
|
|
1524
|
|
|
|
|
|
|
$res = $db->spop($key, [count]); |
1525
|
|
|
|
|
|
|
$db = $db->spop($key, [count], sub { my ($db, $err, $res) = @_ }); |
1526
|
|
|
|
|
|
|
$promise = $db->spop_p($key, [count]); |
1527
|
|
|
|
|
|
|
|
1528
|
|
|
|
|
|
|
Remove and return one or multiple random members from a set. |
1529
|
|
|
|
|
|
|
|
1530
|
|
|
|
|
|
|
See L for more information. |
1531
|
|
|
|
|
|
|
|
1532
|
|
|
|
|
|
|
=head2 srandmember |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
$res = $db->srandmember($key, [count]); |
1535
|
|
|
|
|
|
|
$db = $db->srandmember($key, [count], sub { my ($db, $err, $res) = @_ }); |
1536
|
|
|
|
|
|
|
$promise = $db->srandmember_p($key, [count]); |
1537
|
|
|
|
|
|
|
|
1538
|
|
|
|
|
|
|
Get one or multiple random members from a set. |
1539
|
|
|
|
|
|
|
|
1540
|
|
|
|
|
|
|
See L for more information. |
1541
|
|
|
|
|
|
|
|
1542
|
|
|
|
|
|
|
=head2 srem |
1543
|
|
|
|
|
|
|
|
1544
|
|
|
|
|
|
|
$res = $db->srem($key, $member [member ...]); |
1545
|
|
|
|
|
|
|
$db = $db->srem($key, $member [member ...], sub { my ($db, $err, $res) = @_ }); |
1546
|
|
|
|
|
|
|
$promise = $db->srem_p($key, $member [member ...]); |
1547
|
|
|
|
|
|
|
|
1548
|
|
|
|
|
|
|
Remove one or more members from a set. |
1549
|
|
|
|
|
|
|
|
1550
|
|
|
|
|
|
|
See L for more information. |
1551
|
|
|
|
|
|
|
|
1552
|
|
|
|
|
|
|
=head2 strlen |
1553
|
|
|
|
|
|
|
|
1554
|
|
|
|
|
|
|
$res = $db->strlen($key); |
1555
|
|
|
|
|
|
|
$db = $db->strlen($key, sub { my ($db, $err, $res) = @_ }); |
1556
|
|
|
|
|
|
|
$promise = $db->strlen_p($key); |
1557
|
|
|
|
|
|
|
|
1558
|
|
|
|
|
|
|
Get the length of the value stored in a key. |
1559
|
|
|
|
|
|
|
|
1560
|
|
|
|
|
|
|
See L for more information. |
1561
|
|
|
|
|
|
|
|
1562
|
|
|
|
|
|
|
=head2 sunion |
1563
|
|
|
|
|
|
|
|
1564
|
|
|
|
|
|
|
$res = $db->sunion($key [key ...]); |
1565
|
|
|
|
|
|
|
$db = $db->sunion($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1566
|
|
|
|
|
|
|
$promise = $db->sunion_p($key [key ...]); |
1567
|
|
|
|
|
|
|
|
1568
|
|
|
|
|
|
|
Add multiple sets. |
1569
|
|
|
|
|
|
|
|
1570
|
|
|
|
|
|
|
See L for more information. |
1571
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
=head2 sunionstore |
1573
|
|
|
|
|
|
|
|
1574
|
|
|
|
|
|
|
$res = $db->sunionstore($destination, $key [key ...]); |
1575
|
|
|
|
|
|
|
$db = $db->sunionstore($destination, $key [key ...], sub { my ($db, $err, $res) = @_ }); |
1576
|
|
|
|
|
|
|
$promise = $db->sunionstore_p($destination, $key [key ...]); |
1577
|
|
|
|
|
|
|
|
1578
|
|
|
|
|
|
|
Add multiple sets and store the resulting set in a key. |
1579
|
|
|
|
|
|
|
|
1580
|
|
|
|
|
|
|
See L for more information. |
1581
|
|
|
|
|
|
|
|
1582
|
|
|
|
|
|
|
=head2 time |
1583
|
|
|
|
|
|
|
|
1584
|
|
|
|
|
|
|
$res = $db->time; |
1585
|
|
|
|
|
|
|
$db = $db->time(sub { my ($db, $err, $res) = @_ }); |
1586
|
|
|
|
|
|
|
$promise = $db->time_p; |
1587
|
|
|
|
|
|
|
|
1588
|
|
|
|
|
|
|
Return the current server time. |
1589
|
|
|
|
|
|
|
|
1590
|
|
|
|
|
|
|
See L for more information. |
1591
|
|
|
|
|
|
|
|
1592
|
|
|
|
|
|
|
=head2 touch |
1593
|
|
|
|
|
|
|
|
1594
|
|
|
|
|
|
|
$res = $db->touch($key [key ...]); |
1595
|
|
|
|
|
|
|
$db = $db->touch($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1596
|
|
|
|
|
|
|
$promise = $db->touch_p($key [key ...]); |
1597
|
|
|
|
|
|
|
|
1598
|
|
|
|
|
|
|
Alters the last access time of a key(s). Returns the number of existing keys specified. |
1599
|
|
|
|
|
|
|
|
1600
|
|
|
|
|
|
|
See L for more information. |
1601
|
|
|
|
|
|
|
|
1602
|
|
|
|
|
|
|
=head2 ttl |
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
$res = $db->ttl($key); |
1605
|
|
|
|
|
|
|
$db = $db->ttl($key, sub { my ($db, $err, $res) = @_ }); |
1606
|
|
|
|
|
|
|
$promise = $db->ttl_p($key); |
1607
|
|
|
|
|
|
|
|
1608
|
|
|
|
|
|
|
Get the time to live for a key. |
1609
|
|
|
|
|
|
|
|
1610
|
|
|
|
|
|
|
See L for more information. |
1611
|
|
|
|
|
|
|
|
1612
|
|
|
|
|
|
|
=head2 type |
1613
|
|
|
|
|
|
|
|
1614
|
|
|
|
|
|
|
$res = $db->type($key); |
1615
|
|
|
|
|
|
|
$db = $db->type($key, sub { my ($db, $err, $res) = @_ }); |
1616
|
|
|
|
|
|
|
$promise = $db->type_p($key); |
1617
|
|
|
|
|
|
|
|
1618
|
|
|
|
|
|
|
Determine the type stored at key. |
1619
|
|
|
|
|
|
|
|
1620
|
|
|
|
|
|
|
See L for more information. |
1621
|
|
|
|
|
|
|
|
1622
|
|
|
|
|
|
|
=head2 unlink |
1623
|
|
|
|
|
|
|
|
1624
|
|
|
|
|
|
|
$res = $db->unlink($key [key ...]); |
1625
|
|
|
|
|
|
|
$db = $db->unlink($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1626
|
|
|
|
|
|
|
$promise = $db->unlink_p($key [key ...]); |
1627
|
|
|
|
|
|
|
|
1628
|
|
|
|
|
|
|
Delete a key asynchronously in another thread. Otherwise it is just as DEL, but non blocking. |
1629
|
|
|
|
|
|
|
|
1630
|
|
|
|
|
|
|
See L for more information. |
1631
|
|
|
|
|
|
|
|
1632
|
|
|
|
|
|
|
=head2 unwatch |
1633
|
|
|
|
|
|
|
|
1634
|
|
|
|
|
|
|
$res = $db->unwatch; |
1635
|
|
|
|
|
|
|
$db = $db->unwatch(sub { my ($db, $err, $res) = @_ }); |
1636
|
|
|
|
|
|
|
$promise = $db->unwatch_p; |
1637
|
|
|
|
|
|
|
|
1638
|
|
|
|
|
|
|
Forget about all watched keys. |
1639
|
|
|
|
|
|
|
|
1640
|
|
|
|
|
|
|
See L for more information. |
1641
|
|
|
|
|
|
|
|
1642
|
|
|
|
|
|
|
=head2 watch |
1643
|
|
|
|
|
|
|
|
1644
|
|
|
|
|
|
|
$res = $db->watch($key [key ...]); |
1645
|
|
|
|
|
|
|
$db = $db->watch($key [key ...], sub { my ($db, $err, $res) = @_ }); |
1646
|
|
|
|
|
|
|
$promise = $db->watch_p($key [key ...]); |
1647
|
|
|
|
|
|
|
|
1648
|
|
|
|
|
|
|
Watch the given keys to determine execution of the MULTI/EXEC block. |
1649
|
|
|
|
|
|
|
|
1650
|
|
|
|
|
|
|
See L for more information. |
1651
|
|
|
|
|
|
|
|
1652
|
|
|
|
|
|
|
=head2 xadd |
1653
|
|
|
|
|
|
|
|
1654
|
|
|
|
|
|
|
$res = $db->xadd($key, $ID, $field string [field string ...]); |
1655
|
|
|
|
|
|
|
$db = $db->xadd($key, $ID, $field string [field string ...], sub { my ($db, $err, $res) = @_ }); |
1656
|
|
|
|
|
|
|
$promise = $db->xadd_p($key, $ID, $field string [field string ...]); |
1657
|
|
|
|
|
|
|
|
1658
|
|
|
|
|
|
|
Appends a new entry to a stream. |
1659
|
|
|
|
|
|
|
|
1660
|
|
|
|
|
|
|
See L for more information. |
1661
|
|
|
|
|
|
|
|
1662
|
|
|
|
|
|
|
=head2 xlen |
1663
|
|
|
|
|
|
|
|
1664
|
|
|
|
|
|
|
$res = $db->xlen($key); |
1665
|
|
|
|
|
|
|
$db = $db->xlen($key, sub { my ($db, $err, $res) = @_ }); |
1666
|
|
|
|
|
|
|
$promise = $db->xlen_p($key); |
1667
|
|
|
|
|
|
|
|
1668
|
|
|
|
|
|
|
Return the number of entires in a stream. |
1669
|
|
|
|
|
|
|
|
1670
|
|
|
|
|
|
|
See L for more information. |
1671
|
|
|
|
|
|
|
|
1672
|
|
|
|
|
|
|
=head2 xpending |
1673
|
|
|
|
|
|
|
|
1674
|
|
|
|
|
|
|
$res = $db->xpending($key, $group, [start end count], [consumer]); |
1675
|
|
|
|
|
|
|
$db = $db->xpending($key, $group, [start end count], [consumer], sub { my ($db, $err, $res) = @_ }); |
1676
|
|
|
|
|
|
|
$promise = $db->xpending_p($key, $group, [start end count], [consumer]); |
1677
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged. |
1679
|
|
|
|
|
|
|
|
1680
|
|
|
|
|
|
|
See L for more information. |
1681
|
|
|
|
|
|
|
|
1682
|
|
|
|
|
|
|
=head2 xrange |
1683
|
|
|
|
|
|
|
|
1684
|
|
|
|
|
|
|
$res = $db->xrange($key, $start, $end, [COUNT count]); |
1685
|
|
|
|
|
|
|
$db = $db->xrange($key, $start, $end, [COUNT count], sub { my ($db, $err, $res) = @_ }); |
1686
|
|
|
|
|
|
|
$promise = $db->xrange_p($key, $start, $end, [COUNT count]); |
1687
|
|
|
|
|
|
|
|
1688
|
|
|
|
|
|
|
Return a range of elements in a stream, with IDs matching the specified IDs interval. |
1689
|
|
|
|
|
|
|
|
1690
|
|
|
|
|
|
|
See L for more information. |
1691
|
|
|
|
|
|
|
|
1692
|
|
|
|
|
|
|
=head2 xread |
1693
|
|
|
|
|
|
|
|
1694
|
|
|
|
|
|
|
$res = $db->xread([COUNT count], [BLOCK milliseconds], $STREAMS, $key [key ...], $ID [ID ...]); |
1695
|
|
|
|
|
|
|
$db = $db->xread([COUNT count], [BLOCK milliseconds], $STREAMS, $key [key ...], $ID [ID ...], sub { my ($db, $err, $res) = @_ }); |
1696
|
|
|
|
|
|
|
$promise = $db->xread_p([COUNT count], [BLOCK milliseconds], $STREAMS, $key [key ...], $ID [ID ...]); |
1697
|
|
|
|
|
|
|
|
1698
|
|
|
|
|
|
|
Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block. |
1699
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
See L for more information. |
1701
|
|
|
|
|
|
|
|
1702
|
|
|
|
|
|
|
=head2 xread_structured |
1703
|
|
|
|
|
|
|
|
1704
|
|
|
|
|
|
|
Same as L, but the result is a data structure like this: |
1705
|
|
|
|
|
|
|
|
1706
|
|
|
|
|
|
|
{ |
1707
|
|
|
|
|
|
|
$stream_name => [ |
1708
|
|
|
|
|
|
|
[ $id1 => [@data1] ], |
1709
|
|
|
|
|
|
|
[ $id2 => [@data2] ], |
1710
|
|
|
|
|
|
|
... |
1711
|
|
|
|
|
|
|
] |
1712
|
|
|
|
|
|
|
} |
1713
|
|
|
|
|
|
|
|
1714
|
|
|
|
|
|
|
This method is currently EXPERIMENTAL, but will only change if bugs are |
1715
|
|
|
|
|
|
|
discovered. |
1716
|
|
|
|
|
|
|
|
1717
|
|
|
|
|
|
|
=head2 xreadgroup |
1718
|
|
|
|
|
|
|
|
1719
|
|
|
|
|
|
|
$res = $db->xreadgroup($GROUP group consumer, [COUNT count], [BLOCK milliseconds], $STREAMS, $key [key ...], $ID [ID ...]); |
1720
|
|
|
|
|
|
|
$db = $db->xreadgroup($GROUP group consumer, [COUNT count], [BLOCK milliseconds], $STREAMS, $key [key ...], $ID [ID ...], sub { my ($db, $err, $res) = @_ }); |
1721
|
|
|
|
|
|
|
$promise = $db->xreadgroup_p($GROUP group consumer, [COUNT count], [BLOCK milliseconds], $STREAMS, $key [key ...], $ID [ID ...]); |
1722
|
|
|
|
|
|
|
|
1723
|
|
|
|
|
|
|
Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block. |
1724
|
|
|
|
|
|
|
|
1725
|
|
|
|
|
|
|
See L for more information. |
1726
|
|
|
|
|
|
|
|
1727
|
|
|
|
|
|
|
=head2 xrevrange |
1728
|
|
|
|
|
|
|
|
1729
|
|
|
|
|
|
|
$res = $db->xrevrange($key, $end, $start, [COUNT count]); |
1730
|
|
|
|
|
|
|
$db = $db->xrevrange($key, $end, $start, [COUNT count], sub { my ($db, $err, $res) = @_ }); |
1731
|
|
|
|
|
|
|
$promise = $db->xrevrange_p($key, $end, $start, [COUNT count]); |
1732
|
|
|
|
|
|
|
|
1733
|
|
|
|
|
|
|
Return a range of elements in a stream, with IDs matching the specified IDs interval, in reverse order (from greater to smaller IDs) compared to XRANGE. |
1734
|
|
|
|
|
|
|
|
1735
|
|
|
|
|
|
|
See L for more information. |
1736
|
|
|
|
|
|
|
|
1737
|
|
|
|
|
|
|
=head2 zadd |
1738
|
|
|
|
|
|
|
|
1739
|
|
|
|
|
|
|
$res = $db->zadd($key, [NX|XX], [CH], [INCR], $score member [score member ...]); |
1740
|
|
|
|
|
|
|
$db = $db->zadd($key, [NX|XX], [CH], [INCR], $score member [score member ...], sub {my ($db, $err, $res) = @_ }); |
1741
|
|
|
|
|
|
|
$promise = $db->zadd_p($key, [NX|XX], [CH], [INCR], $score member [score member ...]); |
1742
|
|
|
|
|
|
|
|
1743
|
|
|
|
|
|
|
Add one or more members to a sorted set, or update its score if it already exists. |
1744
|
|
|
|
|
|
|
|
1745
|
|
|
|
|
|
|
See L for more information. |
1746
|
|
|
|
|
|
|
|
1747
|
|
|
|
|
|
|
=head2 zcard |
1748
|
|
|
|
|
|
|
|
1749
|
|
|
|
|
|
|
$res = $db->zcard($key); |
1750
|
|
|
|
|
|
|
$db = $db->zcard($key, sub { my ($db, $err, $res) = @_ }); |
1751
|
|
|
|
|
|
|
$promise = $db->zcard_p($key); |
1752
|
|
|
|
|
|
|
|
1753
|
|
|
|
|
|
|
Get the number of members in a sorted set. |
1754
|
|
|
|
|
|
|
|
1755
|
|
|
|
|
|
|
See L for more information. |
1756
|
|
|
|
|
|
|
|
1757
|
|
|
|
|
|
|
=head2 zcount |
1758
|
|
|
|
|
|
|
|
1759
|
|
|
|
|
|
|
$res = $db->zcount($key, $min, $max); |
1760
|
|
|
|
|
|
|
$db = $db->zcount($key, $min, $max, sub { my ($db, $err, $res) = @_ }); |
1761
|
|
|
|
|
|
|
$promise = $db->zcount_p($key, $min, $max); |
1762
|
|
|
|
|
|
|
|
1763
|
|
|
|
|
|
|
Count the members in a sorted set with scores within the given values. |
1764
|
|
|
|
|
|
|
|
1765
|
|
|
|
|
|
|
See L for more information. |
1766
|
|
|
|
|
|
|
|
1767
|
|
|
|
|
|
|
=head2 zincrby |
1768
|
|
|
|
|
|
|
|
1769
|
|
|
|
|
|
|
$res = $db->zincrby($key, $increment, $member); |
1770
|
|
|
|
|
|
|
$db = $db->zincrby($key, $increment, $member, sub { my ($db, $err, $res) = @_ }); |
1771
|
|
|
|
|
|
|
$promise = $db->zincrby_p($key, $increment, $member); |
1772
|
|
|
|
|
|
|
|
1773
|
|
|
|
|
|
|
Increment the score of a member in a sorted set. |
1774
|
|
|
|
|
|
|
|
1775
|
|
|
|
|
|
|
See L for more information. |
1776
|
|
|
|
|
|
|
|
1777
|
|
|
|
|
|
|
=head2 zinterstore |
1778
|
|
|
|
|
|
|
|
1779
|
|
|
|
|
|
|
$res = $db->zinterstore($destination, $numkeys, $key [key ...], [WEIGHTS weight [weight ...]], [AGGREGATE SUM|MIN|MAX]); |
1780
|
|
|
|
|
|
|
$db = $db->zinterstore($destination, $numkeys, $key [key ...], [WEIGHTS weight [weight ...]], [AGGREGATE SUM|MIN|MAX], sub { my ($db, $err, $res) = @_ }); |
1781
|
|
|
|
|
|
|
$promise = $db->zinterstore_p($destination, $numkeys, $key [key ...], [WEIGHTS weight [weight ...]], [AGGREGATE SUM|MIN|MAX]); |
1782
|
|
|
|
|
|
|
|
1783
|
|
|
|
|
|
|
Intersect multiple sorted sets and store the resulting sorted set in a new key. |
1784
|
|
|
|
|
|
|
|
1785
|
|
|
|
|
|
|
See L for more information. |
1786
|
|
|
|
|
|
|
|
1787
|
|
|
|
|
|
|
=head2 zlexcount |
1788
|
|
|
|
|
|
|
|
1789
|
|
|
|
|
|
|
$res = $db->zlexcount($key, $min, $max); |
1790
|
|
|
|
|
|
|
$db = $db->zlexcount($key, $min, $max, sub { my ($db, $err, $res) = @_ }); |
1791
|
|
|
|
|
|
|
$promise = $db->zlexcount_p($key, $min, $max); |
1792
|
|
|
|
|
|
|
|
1793
|
|
|
|
|
|
|
Count the number of members in a sorted set between a given lexicographical range. |
1794
|
|
|
|
|
|
|
|
1795
|
|
|
|
|
|
|
See L for more information. |
1796
|
|
|
|
|
|
|
|
1797
|
|
|
|
|
|
|
=head2 zpopmax |
1798
|
|
|
|
|
|
|
|
1799
|
|
|
|
|
|
|
$res = $db->zpopmax($key, [count]); |
1800
|
|
|
|
|
|
|
$db = $db->zpopmax($key, [count], sub { my ($db, $err, $res) = @_ }); |
1801
|
|
|
|
|
|
|
$promise = $db->zpopmax_p($key, [count]); |
1802
|
|
|
|
|
|
|
|
1803
|
|
|
|
|
|
|
Remove and return members with the highest scores in a sorted set. |
1804
|
|
|
|
|
|
|
|
1805
|
|
|
|
|
|
|
See L for more information. |
1806
|
|
|
|
|
|
|
|
1807
|
|
|
|
|
|
|
=head2 zpopmin |
1808
|
|
|
|
|
|
|
|
1809
|
|
|
|
|
|
|
$res = $db->zpopmin($key, [count]); |
1810
|
|
|
|
|
|
|
$db = $db->zpopmin($key, [count], sub { my ($db, $err, $res) = @_ }); |
1811
|
|
|
|
|
|
|
$promise = $db->zpopmin_p($key, [count]); |
1812
|
|
|
|
|
|
|
|
1813
|
|
|
|
|
|
|
Remove and return members with the lowest scores in a sorted set. |
1814
|
|
|
|
|
|
|
|
1815
|
|
|
|
|
|
|
See L for more information. |
1816
|
|
|
|
|
|
|
|
1817
|
|
|
|
|
|
|
=head2 zrange |
1818
|
|
|
|
|
|
|
|
1819
|
|
|
|
|
|
|
$res = $db->zrange($key, $start, $stop, [WITHSCORES]); |
1820
|
|
|
|
|
|
|
$db = $db->zrange($key, $start, $stop, [WITHSCORES], sub { my ($db, $err, $res) = @_ }); |
1821
|
|
|
|
|
|
|
$promise = $db->zrange_p($key, $start, $stop, [WITHSCORES]); |
1822
|
|
|
|
|
|
|
|
1823
|
|
|
|
|
|
|
Return a range of members in a sorted set, by index. |
1824
|
|
|
|
|
|
|
|
1825
|
|
|
|
|
|
|
See L for more information. |
1826
|
|
|
|
|
|
|
|
1827
|
|
|
|
|
|
|
=head2 zrangebylex |
1828
|
|
|
|
|
|
|
|
1829
|
|
|
|
|
|
|
$res = $db->zrangebylex($key, $min, $max, [LIMIT offset count]); |
1830
|
|
|
|
|
|
|
$db = $db->zrangebylex($key, $min, $max, [LIMIT offset count], sub { my ($db, $err, $res) = @_ }); |
1831
|
|
|
|
|
|
|
$promise = $db->zrangebylex_p($key, $min, $max, [LIMIT offset count]); |
1832
|
|
|
|
|
|
|
|
1833
|
|
|
|
|
|
|
Return a range of members in a sorted set, by lexicographical range. |
1834
|
|
|
|
|
|
|
|
1835
|
|
|
|
|
|
|
See L for more information. |
1836
|
|
|
|
|
|
|
|
1837
|
|
|
|
|
|
|
=head2 zrangebyscore |
1838
|
|
|
|
|
|
|
|
1839
|
|
|
|
|
|
|
$res = $db->zrangebyscore($key, $min, $max, [WITHSCORES], [LIMIT offset count]); |
1840
|
|
|
|
|
|
|
$db = $db->zrangebyscore($key, $min, $max, [WITHSCORES], [LIMIT offset count], sub {my ($db, $err, $res) = @_ }); |
1841
|
|
|
|
|
|
|
$promise = $db->zrangebyscore_p($key, $min, $max, [WITHSCORES], [LIMIT offset count]); |
1842
|
|
|
|
|
|
|
|
1843
|
|
|
|
|
|
|
Return a range of members in a sorted set, by score. |
1844
|
|
|
|
|
|
|
|
1845
|
|
|
|
|
|
|
See L for more information. |
1846
|
|
|
|
|
|
|
|
1847
|
|
|
|
|
|
|
=head2 zrank |
1848
|
|
|
|
|
|
|
|
1849
|
|
|
|
|
|
|
$res = $db->zrank($key, $member); |
1850
|
|
|
|
|
|
|
$db = $db->zrank($key, $member, sub { my ($db, $err, $res) = @_ }); |
1851
|
|
|
|
|
|
|
$promise = $db->zrank_p($key, $member); |
1852
|
|
|
|
|
|
|
|
1853
|
|
|
|
|
|
|
Determine the index of a member in a sorted set. |
1854
|
|
|
|
|
|
|
|
1855
|
|
|
|
|
|
|
See L for more information. |
1856
|
|
|
|
|
|
|
|
1857
|
|
|
|
|
|
|
=head2 zrem |
1858
|
|
|
|
|
|
|
|
1859
|
|
|
|
|
|
|
$res = $db->zrem($key, $member [member ...]); |
1860
|
|
|
|
|
|
|
$db = $db->zrem($key, $member [member ...], sub { my ($db, $err, $res) = @_ }); |
1861
|
|
|
|
|
|
|
$promise = $db->zrem_p($key, $member [member ...]); |
1862
|
|
|
|
|
|
|
|
1863
|
|
|
|
|
|
|
Remove one or more members from a sorted set. |
1864
|
|
|
|
|
|
|
|
1865
|
|
|
|
|
|
|
See L for more information. |
1866
|
|
|
|
|
|
|
|
1867
|
|
|
|
|
|
|
=head2 zremrangebylex |
1868
|
|
|
|
|
|
|
|
1869
|
|
|
|
|
|
|
$res = $db->zremrangebylex($key, $min, $max); |
1870
|
|
|
|
|
|
|
$db = $db->zremrangebylex($key, $min, $max, sub { my ($db, $err, $res) = @_ }); |
1871
|
|
|
|
|
|
|
$promise = $db->zremrangebylex_p($key, $min, $max); |
1872
|
|
|
|
|
|
|
|
1873
|
|
|
|
|
|
|
Remove all members in a sorted set between the given lexicographical range. |
1874
|
|
|
|
|
|
|
|
1875
|
|
|
|
|
|
|
See L for more information. |
1876
|
|
|
|
|
|
|
|
1877
|
|
|
|
|
|
|
=head2 zremrangebyrank |
1878
|
|
|
|
|
|
|
|
1879
|
|
|
|
|
|
|
$res = $db->zremrangebyrank($key, $start, $stop); |
1880
|
|
|
|
|
|
|
$db = $db->zremrangebyrank($key, $start, $stop, sub { my ($db, $err, $res) = @_ }); |
1881
|
|
|
|
|
|
|
$promise = $db->zremrangebyrank_p($key, $start, $stop); |
1882
|
|
|
|
|
|
|
|
1883
|
|
|
|
|
|
|
Remove all members in a sorted set within the given indexes. |
1884
|
|
|
|
|
|
|
|
1885
|
|
|
|
|
|
|
See L for more information. |
1886
|
|
|
|
|
|
|
|
1887
|
|
|
|
|
|
|
=head2 zremrangebyscore |
1888
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
$res = $db->zremrangebyscore($key, $min, $max); |
1890
|
|
|
|
|
|
|
$db = $db->zremrangebyscore($key, $min, $max, sub { my ($db, $err, $res) = @_ }); |
1891
|
|
|
|
|
|
|
$promise = $db->zremrangebyscore_p($key, $min, $max); |
1892
|
|
|
|
|
|
|
|
1893
|
|
|
|
|
|
|
Remove all members in a sorted set within the given scores. |
1894
|
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
|
See L for more information. |
1896
|
|
|
|
|
|
|
|
1897
|
|
|
|
|
|
|
=head2 zrevrange |
1898
|
|
|
|
|
|
|
|
1899
|
|
|
|
|
|
|
$res = $db->zrevrange($key, $start, $stop, [WITHSCORES]); |
1900
|
|
|
|
|
|
|
$db = $db->zrevrange($key, $start, $stop, [WITHSCORES], sub { my ($db, $err, $res) = @_ }); |
1901
|
|
|
|
|
|
|
$promise = $db->zrevrange_p($key, $start, $stop, [WITHSCORES]); |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
Return a range of members in a sorted set, by index, with scores ordered from high to low. |
1904
|
|
|
|
|
|
|
|
1905
|
|
|
|
|
|
|
See L for more information. |
1906
|
|
|
|
|
|
|
|
1907
|
|
|
|
|
|
|
=head2 zrevrangebylex |
1908
|
|
|
|
|
|
|
|
1909
|
|
|
|
|
|
|
$res = $db->zrevrangebylex($key, $max, $min, [LIMIT offset count]); |
1910
|
|
|
|
|
|
|
$db = $db->zrevrangebylex($key, $max, $min, [LIMIT offset count], sub { my ($db, $err, $res) = @_ }); |
1911
|
|
|
|
|
|
|
$promise = $db->zrevrangebylex_p($key, $max, $min, [LIMIT offset count]); |
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings. |
1914
|
|
|
|
|
|
|
|
1915
|
|
|
|
|
|
|
See L for more information. |
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
=head2 zrevrangebyscore |
1918
|
|
|
|
|
|
|
|
1919
|
|
|
|
|
|
|
$res = $db->zrevrangebyscore($key, $max, $min, [WITHSCORES], [LIMIT offset count]); |
1920
|
|
|
|
|
|
|
$db = $db->zrevrangebyscore($key, $max, $min, [WITHSCORES], [LIMIT offset count], sub { my ($db, $err, $res) = @_ }); |
1921
|
|
|
|
|
|
|
$promise = $db->zrevrangebyscore_p($key, $max, $min, [WITHSCORES], [LIMIT offset count]); |
1922
|
|
|
|
|
|
|
|
1923
|
|
|
|
|
|
|
Return a range of members in a sorted set, by score, with scores ordered from high to low. |
1924
|
|
|
|
|
|
|
|
1925
|
|
|
|
|
|
|
See L for more information. |
1926
|
|
|
|
|
|
|
|
1927
|
|
|
|
|
|
|
=head2 zrevrank |
1928
|
|
|
|
|
|
|
|
1929
|
|
|
|
|
|
|
$res = $db->zrevrank($key, $member); |
1930
|
|
|
|
|
|
|
$db = $db->zrevrank($key, $member, sub { my ($db, $err, $res) = @_ }); |
1931
|
|
|
|
|
|
|
$promise = $db->zrevrank_p($key, $member); |
1932
|
|
|
|
|
|
|
|
1933
|
|
|
|
|
|
|
Determine the index of a member in a sorted set, with scores ordered from high to low. |
1934
|
|
|
|
|
|
|
|
1935
|
|
|
|
|
|
|
See L for more information. |
1936
|
|
|
|
|
|
|
|
1937
|
|
|
|
|
|
|
=head2 zscore |
1938
|
|
|
|
|
|
|
|
1939
|
|
|
|
|
|
|
$res = $db->zscore($key, $member); |
1940
|
|
|
|
|
|
|
$db = $db->zscore($key, $member, sub { my ($db, $err, $res) = @_ }); |
1941
|
|
|
|
|
|
|
$promise = $db->zscore_p($key, $member); |
1942
|
|
|
|
|
|
|
|
1943
|
|
|
|
|
|
|
Get the score associated with the given member in a sorted set. |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
See L for more information. |
1946
|
|
|
|
|
|
|
|
1947
|
|
|
|
|
|
|
=head2 zunionstore |
1948
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
$res = $db->zunionstore($destination, $numkeys, $key [key ...], [WEIGHTS weight [weight ...]], [AGGREGATE SUM|MIN|MAX]); |
1950
|
|
|
|
|
|
|
$db = $db->zunionstore($destination, $numkeys, $key [key ...], [WEIGHTS weight [weight ...]], [AGGREGATE SUM|MIN|MAX], sub { my ($db, $err, $res) = @_ }); |
1951
|
|
|
|
|
|
|
$promise = $db->zunionstore_p($destination, $numkeys, $key [key ...], [WEIGHTS weight [weight ...]], [AGGREGATE SUM|MIN|MAX]); |
1952
|
|
|
|
|
|
|
|
1953
|
|
|
|
|
|
|
Add multiple sorted sets and store the resulting sorted set in a new key. |
1954
|
|
|
|
|
|
|
|
1955
|
|
|
|
|
|
|
See L for more information. |
1956
|
|
|
|
|
|
|
|
1957
|
|
|
|
|
|
|
=head1 SEE ALSO |
1958
|
|
|
|
|
|
|
|
1959
|
|
|
|
|
|
|
L. |
1960
|
|
|
|
|
|
|
|
1961
|
|
|
|
|
|
|
=cut |