首页 / REDIS / redis 命令都在这了
redis 命令都在这了
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了redis 命令都在这了,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含14564字,纯文字阅读大概需要21分钟。
内容图文
![redis 命令都在这了](/upload/InfoBanner/zyjiaocheng/897/8158959bd6d1401da9ce7705a4a14e79.jpg)
- DEL?key [key ...]删除指定的key(一个或多个)
- DUMP?key导出key的值
- EXISTS?key [key ...]查询一个key是否存在
- EXPIRE?key seconds设置一个key的过期的秒数
- EXPIREAT?key timestamp设置一个UNIX时间戳的过期时间
- KEYS?pattern查找所有匹配给定的模式的键
- MIGRATE?host port key destination-db timeout [COPY] [REPLACE]原子性的将key从redis的一个实例移到另一个实例
- MOVE?key db移动一个key到另一个数据库
- OBJECT?subcommand [arguments [arguments ...]]检查内部的再分配对象
- PERSIST?key移除key的过期时间
- PEXPIRE?key milliseconds设置key的有效时间以毫秒为单位
- PEXPIREAT?key milliseconds-timestamp设置key的到期UNIX时间戳以毫秒为单位
- PTTL?key获取key的有效毫秒数
- RANDOMKEY?返回一个随机的key
- RENAME?key newkey将一个key重命名
- RENAMENX?key newkey重命名一个key,新的key必须是不存在的key
- RESTORE?key ttl serialized-value [REPLACE]Create a key using the provided serialized value, previously obtained using DUMP.
- SORT?key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC|DESC] [ALPHA] [STORE destination]对队列、集合、有序集合排序
- TTL?key获取key的有效时间(单位:秒)
- TYPE?key获取key的存储类型
- WAIT?numslaves timeoutWait for the synchronous replication of all the write commands sent in the context of the current connection
- SCAN?cursor [MATCH pattern] [COUNT count]增量迭代key
- APPEND?key value追加一个值到key上
- BITCOUNT?key [start end]统计字符串指定起始位置的字节数
- BITFIELD?key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]Perform arbitrary bitfield integer operations on strings
- BITOP?operation destkey key [key ...]Perform bitwise operations between strings
- BITPOS?key bit [start] [end]Find first bit set or clear in a string
- DECR?key整数原子减1
- DECRBY?key decrement原子减指定的整数
- GET?key返回key的value
- GETBIT?key offset返回位的值存储在关键的字符串值的偏移量。
- GETRANGE?key start end获取存储在key上的值的一个子字符串
- GETSET?key value设置一个key的value,并获取设置前的值
- INCR?key执行原子加1操作
- INCRBY?key increment执行原子增加一个整数
- INCRBYFLOAT?key increment执行原子增加一个浮点数
- MGET?key [key ...]获得所有key的值
- MSET?key value [key value ...]设置多个key value
- MSETNX?key value [key value ...]设置多个key value,仅当key存在时
- PSETEX?key milliseconds valueSet the value and expiration in milliseconds of a key
- SET?key value [EX seconds] [PX milliseconds] [NX|XX]设置一个key的value值
- SETBIT?key offset valueSets or clears the bit at offset in the string value stored at key
- SETEX?key seconds value设置key-value并设置过期时间(单位:秒)
- SETNX?key value设置的一个关键的价值,只有当该键不存在
- SETRANGE?key offset valueOverwrite part of a string at key starting at the specified offset
- STRLEN?key获取指定key值的长度
- BLPOP?key [key ...] timeout删除,并获得该列表中的第一元素,或阻塞,直到有一个可用
- BRPOP?key [key ...] timeout删除,并获得该列表中的最后一个元素,或阻塞,直到有一个可用
- BRPOPLPUSH?source destination timeout弹出一个列表的值,将它推到另一个列表,并返回它;或阻塞,直到有一个可用
- LINDEX?key index获取一个元素,通过其索引列表
- LINSERT?key BEFORE|AFTER pivot value在列表中的另一个元素之前或之后插入一个元素
- LLEN?key获得队列(List)的长度
- 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从队列的右边入队一个元素,仅队列存在时有效
- PSUBSCRIBE?pattern [pattern ...]Listen for messages published to channels matching the given patterns
- PUBSUB?subcommand [argument [argument ...]]Inspect the state of the Pub/Sub subsystem
- PUBLISH?channel message发布一条消息到频道
- PUNSUBSCRIBE?[pattern [pattern ...]]停止发布到匹配给定模式的渠道的消息听
- SUBSCRIBE?channel [channel ...]监听频道发布的消息
- UNSUBSCRIBE?[channel [channel ...]]停止频道监听
- EVAL?script numkeys key [key ...] arg [arg ...]在服务器端执行 LUA 脚本
- EVALSHA?sha1 numkeys key [key ...] arg [arg ...]在服务器端执行 LUA 脚本
- SCRIPT DEBUG?YES|SYNC|NOSet the debug mode for executed scripts.
- SCRIPT EXISTS?script [script ...]Check existence of scripts in the script cache.
- SCRIPT FLUSH?删除服务器缓存中所有Lua脚本。
- SCRIPT KILL?杀死当前正在运行的 Lua 脚本。
- SCRIPT LOAD?script从服务器缓存中装载一个Lua脚本。
- BGREWRITEAOF?异步重写追加文件命令
- BGSAVE?异步保存数据集到磁盘上
- CLIENT KILL?[ip:port] [ID client-id] [TYPE normal|slave|pubsub] [ADDR ip:port] [SKIPME yes/no]关闭客户端连接
- CLIENT LIST?获得客户端连接列表
- CLIENT GETNAME?获得当前连接名称
- CLIENT ID?Returns the client ID for the current connection
- CLIENT PAUSE?timeout暂停处理客户端命令
- CLIENT REPLY?ON|OFF|SKIPInstruct the server whether to reply to commands
- CLIENT SETNAME?connection-name设置当前连接的名字
- CLIENT UNBLOCK?client-id [TIMEOUT|ERROR]Unblock a client blocked in a blocking command from a different connection
- COMMAND?Get array of Redis command details
- COMMAND COUNT?Get total number of Redis commands
- COMMAND GETKEYS?Extract keys given a full Redis command
- COMMAND INFO?command-name [command-name ...]Get array of specific Redis command details
- CONFIG GET?parameter获取配置参数的值
- CONFIG REWRITE?从写内存中的配置文件
- CONFIG SET?parameter value设置配置文件
- CONFIG RESETSTAT?复位再分配使用info命令报告的统计
- DBSIZE?返回当前数据库里面的keys数量
- DEBUG OBJECT?key获取一个key的debug信息
- DEBUG SEGFAULT?使服务器崩溃命令
- FLUSHALL?清空所有数据库命令
- FLUSHDB?清空当前的数据库命令
- INFO?[section]获得服务器的详细信息
- LASTSAVE?获得最后一次同步磁盘的时间
- MEMORY DOCTOR?Outputs memory problems report
- MEMORY HELP?Show helpful text about the different subcommands
- MEMORY-MALLOC-STATS?Show allocator internal stats
- MEMORY-PURGE?Ask the allocator to release memory
- MEMORY-STATS?Show memory usage details
- MEMORY-USAGE?key [SAMPLES count]Estimate the memory usage of a key
- MONITOR?实时监控服务器
- REPLICAOF?host portMake the server a replica of another instance, or promote it as master.
- ROLE?Return the role of the instance in the context of replication
- SAVE?同步数据到磁盘上
- SHUTDOWN?[NOSAVE] [SAVE]关闭服务
- SLAVEOF?host port指定当前服务器的主服务器
- SLOWLOG?subcommand [argument]管理再分配的慢查询日志
- SYNC?用于复制的内部命令
- TIME?返回当前服务器时间
- SADD?key member [member ...]添加一个或者多个元素到集合(set)里
- SCARD?key获取集合里面的元素数量
- SDIFF?key [key ...]获得队列不存在的元素
- SDIFFSTORE?destination key [key ...]获得队列不存在的元素,并存储在一个关键的结果集
- SINTER?key [key ...]获得两个集合的交集
- SINTERSTORE?destination key [key ...]获得两个集合的交集,并存储在一个关键的结果集
- SISMEMBER?key member确定一个给定的值是一个集合的成员
- SMEMBERS?key获取集合里面的所有元素
- SMOVE?source destination member移动集合里面的一个元素到另一个集合
- SPOP?key [count]删除并获取一个集合里面的元素
- SRANDMEMBER?key [count]从集合里面随机获取一个元素
- SREM?key member [member ...]从集合里删除一个或多个元素
- SUNION?key [key ...]添加多个set元素
- SUNIONSTORE?destination key [key ...]合并set元素,并将结果存入新的set里面
- SSCAN?key cursor [MATCH pattern] [COUNT count]迭代set里面的元素
- ZADD?key [NX|XX] [CH] [INCR] score member [score member ...]添加到有序set的一个或多个成员,或更新的分数,如果它已经存在
- ZCARD?key获取一个排序的集合中的成员数量
- ZCOUNT?key min max返回分数范围内的成员数量
- ZINCRBY?key increment member增量的一名成员在排序设置的评分
- ZINTERSTORE?destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]相交多个排序集,导致排序的设置存储在一个新的关键
- ZLEXCOUNT?key min max返回成员之间的成员数量
- ZPOPMAX?key [count]Remove and return members with the highest scores in a sorted set
- ZPOPMIN?key [count]Remove and return members with the lowest scores in a sorted set
- ZRANGE?key start stop [WITHSCORES]根据指定的index返回,返回sorted set的成员列表
- ZRANGEBYLEX?key min max [LIMIT offset count]返回指定成员区间内的成员,按字典正序排列, 分数必须相同。
- ZREVRANGEBYLEX?key max min [LIMIT offset count]返回指定成员区间内的成员,按字典倒序排列, 分数必须相同
- ZRANGEBYSCORE?key min max [WITHSCORES] [LIMIT offset count]返回有序集合中指定分数区间内的成员,分数由低到高排序。
- ZRANK?key member确定在排序集合成员的索引
- ZREM?key member [member ...]从排序的集合中删除一个或多个成员
- ZREMRANGEBYLEX?key min max删除名称按字典由低到高排序成员之间所有成员。
- ZREMRANGEBYRANK?key start stop在排序设置的所有成员在给定的索引中删除
- ZREMRANGEBYSCORE?key min max删除一个排序的设置在给定的分数所有成员
- ZREVRANGE?key start stop [WITHSCORES]在排序的设置返回的成员范围,通过索引,下令从分数高到低
- ZREVRANGEBYSCORE?key max min [WITHSCORES] [LIMIT offset count]返回有序集合中指定分数区间内的成员,分数由高到低排序。
- ZREVRANK?key member确定指数在排序集的成员,下令从分数高到低
- ZSCORE?key member获取成员在排序设置相关的比分
- ZUNIONSTORE?destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM|MIN|MAX]添加多个排序集和导致排序的设置存储在一个新的关键
- ZSCAN?key cursor [MATCH pattern] [COUNT count]迭代sorted sets里面的元素
- XACK?key group ID [ID ...]Marks a pending message as correctly processed, effectively removing it from the pending entries list of the consumer group. Return value of the command is the number of messages successfully acknowledged, that is, the IDs we were actually able to resolve in the PEL.
- XADD?key ID field string [field string ...]Appends a new entry to a stream
- XCLAIM?key group consumer min-idle-time ID [ID ...] [IDLE ms] [TIME ms-unix-time] [RETRYCOUNT count] [FORCE] [JUSTID]Changes (or acquires) ownership of a message in a consumer group, as if the message was delivered to the specified consumer.
- XDEL?key ID [ID ...]Removes the specified entries from the stream. Returns the number of items actually deleted, that may be different from the number of IDs passed in case certain IDs do not exist.
- XGROUP?[CREATE key groupname id-or-$] [SETID key id-or-$] [DESTROY key groupname] [DELCONSUMER key groupname consumername]Create, destroy, and manage consumer groups.
- XINFO?[CONSUMERS key groupname] [GROUPS key] [STREAM key] [HELP]Get information on streams and consumer groups
- XLEN?keyReturn the number of entires in a stream
- XPENDING?key group [start end count] [consumer]Return information and entries from a stream consumer group pending entries list, that are messages fetched but never acknowledged.
- XRANGE?key start end [COUNT count]Return a range of elements in a stream, with IDs matching the specified IDs interval
- XREAD?[COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]Return never seen elements in multiple streams, with IDs greater than the ones reported by the caller for each stream. Can block.
- XREADGROUP?GROUP group consumer [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]Return new entries from a stream using a consumer group, or access the history of the pending entries for a given consumer. Can block.
- XREVRANGE?key end start [COUNT count]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
- XTRIM?key MAXLEN [~] countTrims the stream to (approximately if '~' is passed) a certain size
- DISCARD?丢弃所有 MULTI 之后发的命令
- EXEC?执行所有 MULTI 之后发的命令
- MULTI?标记一个事务块开始
- UNWATCH?取消事务命令
- WATCH?key [key ...]锁定key直到执行了 MULTI/EXEC 命令
- PFADD?key element [element ...]将指定元素添加到HyperLogLog
- PFCOUNT?key [key ...]Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s).
- PFMERGE?destkey sourcekey [sourcekey ...]Merge N different HyperLogLogs into a single one.
- HDEL?key field [field ...]删除一个或多个Hash的field
- HEXISTS?key field判断field是否存在于hash中
- HGET?key field获取hash中field的值
- HGETALL?key从hash中读取全部的域和值
- HINCRBY?key field increment将hash中指定域的值增加给定的数字
- HINCRBYFLOAT?key field increment将hash中指定域的值增加给定的浮点数
- HKEYS?key获取hash的所有字段
- HLEN?key获取hash里所有字段的数量
- HMGET?key field [field ...]获取hash里面指定字段的值
- HMSET?key field value [field value ...]设置hash字段值
- HSET?key field value设置hash里面一个字段的值
- HSETNX?key field value设置hash的一个字段,只有当这个字段不存在时有效
- HSTRLEN?key field获取hash里面指定field的长度
- HVALS?key获得hash的所有值
- HSCAN?key cursor [MATCH pattern] [COUNT count]迭代hash里面的元素
- GEOADD?key longitude latitude member [longitude latitude member ...]添加一个或多个地理空间位置到sorted set
- GEOHASH?key member [member ...]返回一个标准的地理空间的Geohash字符串
- GEOPOS?key member [member ...]返回地理空间的经纬度
- GEODIST?key member1 member2 [unit]返回两个地理空间之间的距离
- GEORADIUS?key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count]查询指定半径内所有的地理空间元素的集合。
- GEORADIUSBYMEMBER?key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count]查询指定半径内匹配到的最大距离的一个地理空间元素。
- AUTH?password验证服务器命令
- ECHO?message回显输入的字符串
- PING?Ping 服务器
- QUIT?关闭连接,退出
- SELECT?index选择新数据库
- SWAPDB?index indexSwaps two Redis databases
- CLUSTER ADDSLOTS?slot [slot ...]Assign new hash slots to receiving node
- CLUSTER COUNT-FAILURE-REPORTS?node-idReturn the number of failure reports active for a given node
- CLUSTER COUNTKEYSINSLOT?slotReturn the number of local keys in the specified hash slot
- CLUSTER DELSLOTS?slot [slot ...]Set hash slots as unbound in receiving node
- CLUSTER FAILOVER?[FORCE|TAKEOVER]Forces a slave to perform a manual failover of its master.
- CLUSTER FORGET?node-idRemove a node from the nodes table
- CLUSTER GETKEYSINSLOT?slot countReturn local key names in the specified hash slot
- CLUSTER INFO?Provides info about Redis Cluster node state
- CLUSTER KEYSLOT?keyReturns the hash slot of the specified key
- CLUSTER MEET?ip portForce a node cluster to handshake with another node
- CLUSTER NODES?Get Cluster config for the node
- CLUSTER REPLICAS?node-idList replica nodes of the specified master node
- CLUSTER REPLICATE?node-idReconfigure a node as a slave of the specified master node
- CLUSTER RESET?[HARD|SOFT]Reset a Redis Cluster node
- CLUSTER SAVECONFIG?Forces the node to save cluster state on disk
- CLUSTER SET-CONFIG-EPOCH?config-epochSet the configuration epoch in a new node
- CLUSTER SETSLOT?slot IMPORTING|MIGRATING|STABLE|NODE [node-id]Bind an hash slot to a specific node
- CLUSTER SLAVES?node-idList slave nodes of the specified master node
- CLUSTER SLOTS?Get array of Cluster slot to node mappings
- READONLY?Enables read queries for a connection to a cluster slave node
- READWRITE?Disables read queries for a connection to a cluster slave node
内容总结
以上是互联网集市为您收集整理的redis 命令都在这了全部内容,希望文章能够帮你解决redis 命令都在这了所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。