博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Redis Command
阅读量:5174 次
发布时间:2019-06-13

本文共 3169 字,大约阅读时间需要 10 分钟。

键值操作

get key

set key value

incr key

decr key

del key [key ...]

rename key newkey

renamenx key newkey

keys pattern

incrby key increment

incrbyfloat key increment

append key value

decrby key decrement

dump key

restore key ttl serialized-value

exists key

getbit key offset

getset key value

setnx key value

mget key [key ...]

mset key value [key value ...]

msetnx key value [key value ...]

flushall 删除所有数据库的数据

flushdb 删除当前数据库的所有数据

move key db

randomkey

setbit key offset value

setrange key offset value

strlen key

type key

 

操作hash数组

hdel  key field [field ...]

hexists key field

hget key field

hgetall key

hincrby key field increment

hincrbyfloat key field increment

hkeys key

hlen key

hmget key field [field ...]

hmset key field value [field value ...]

hset key field value

hsetnx key filed value

hvals key

 

操作列表

blpop key [key ...] timeout

brpop key [key ...] timeout

brpoplpush source destination timeout

getrange

lindex key index

linsert key before|after pivot value

llen key

lpop key

lpush key value [value ...]

lpushx key value

lrange key start stop

lrem key count value

lset key index value

ltrim key start stop

rpop key

rpoplpush source destination

rpush key value [value ...]

rpushx key value

 

Set操作

sadd key member [member ...]

scard key 获取set中元素总数

sdiff key [key ...]

ssdiffstore destination key [key ...]

sinter key [key ...]

sinterstore destination key [key ...]

sismember key member

smembers key

smove source destination member

sort key [by pattern] [limit offset count] [get pattern [get pattern ...]] [asc|desc] [alpha] [store destination]

spop key

srandmember key

srem key member [member ...]

sunion key [key ...]

sunionstore destination key [key ...]

zadd key score member [score] [member]

zcard key

zcount key min max

zincrby key increment member

zinterstore destination member key [key ...]

zrange key start stop [withscores]

zrangebyscore key min max

zrank key member

zrem key member [member ...]

zremrangebyrank key start stop

zremrangebyscore key min max

zrevrange key start top [withscores]

zrevrangebyscore key max min [withscores]

zrevrank key member

zscore key member

zunionstore destination numbers key [key ...]

 

键值生命周期管理

pexpire key milliseconds

pexpireat key milliseconds-timestamp

expire key seconds

expireat key timestamp

persist key

psetex key milliseconds value

pttl key

setex key seconds value

ttl key

 

事务

multi 标识一次事务的开始

 

订阅相关

psubscribe pattern [pattern ...]

publish channel message

punsubscribe [pattern [pattern ...]]

subscribe channel [channel ...]

unsubscribe [channel [channel ...]]

 

配置获取

config get parameter

config set parameter value

config resetstat

 

数据库操作

dbsize

info

select index

discard

exec

quit

shutdown [nosave] [save]

 

调试与监控相关

debug object key

debug segfault

echo message

monitor

object subcommand [arguments [arguments ...]]

ping

slowlog subcommand [argument]

time

unwatch

watch key [key ...]

 

授权

auth password

 

数据持久化存储

bgrewriteaof

bgsave

lastsave

save

 

外部扩展

eval script numkeys key [key ...] arg [arg ...]

script exists script [script ...]

script flush 删除所有缓存的脚本

script kill

script load script

migrate host port destination-db timeout

slaveof host port

sync

转载于:https://www.cnblogs.com/lavieenrose/archive/2012/05/04/2483534.html

你可能感兴趣的文章
判断字符串是否为空的注意事项
查看>>
布兰诗歌
查看>>
(转)Tomcat 8 安装和配置、优化
查看>>
(转)Linxu磁盘体系知识介绍及磁盘介绍
查看>>
跨域问题整理
查看>>
[Linux]文件浏览
查看>>
获取国内随机IP的函数
查看>>
Spring Mvc模式下Jquery Ajax 与后台交互操作
查看>>
(转)matlab练习程序(HOG方向梯度直方图)
查看>>
tableView
查看>>
Happy Great BG-卡精度
查看>>
TCP/IP 邮件的原理
查看>>
原型设计工具
查看>>
windows下的C++ socket服务器(4)
查看>>
css3 2d转换3d转换以及动画的知识点汇总
查看>>
计算机改名导致数据库链接的诡异问题
查看>>
Java8内存模型—永久代(PermGen)和元空间(Metaspace)(转)
查看>>
centos 引导盘
查看>>
Notes of Daily Scrum Meeting(12.8)
查看>>
Apriori算法
查看>>