redis命令学习
来源:互联网 发布:手机淘宝降价提醒设置 编辑:程序博客网 时间:2024/06/16 03:57
redis web 在线测试版 http://try.redis.io/
CommandReference
Every command name links to a specific wiki page describing the behavior of the command.Every command name links to a specific wiki page describing the behavior of the command.
CommandReference: Contents
Categorized Command List
Connection handling
Commands operating on all value types
Commands operating on string values
Commands operating on lists
Commands operating on sets
Commands operating on sorted zsets (sorted sets)
Commands operating on hashes
Sorting
Transactions
Publish/Subscribe
Persistence control commands
Remote server control commands
Categorized Command List
Connection handling
Commands operating on all value types
Commands operating on string values
Commands operating on lists
Commands operating on sets
Commands operating on sorted zsets (sorted sets)
Commands operating on hashes
Sorting
Transactions
Publish/Subscribe
Persistence control commands
Remote server control commands
Categorized Command List
Connection handling
CommandParametersDescriptionQUIT-close the connectionAUTHpasswordsimple password authentication if enabledCommands operating on all value types
CommandParametersDescriptionEXISTSkeytest if a key existsDELkeydelete a keyTYPEkeyreturn the type of the value stored at keyKEYSpatternreturn all the keys matching a given patternRANDOMKEY-return a random key from the key spaceRENAMEoldname newnamerename the old key in the new one, destroying the newname key if it already existsRENAMENXoldname newnamerename the oldname key tonewname, if thenewname key does not already existDBSIZE-return the number of keys in the current dbEXPIRE-set a time to live in seconds on a keyPERSIST-remove the expire from a keyTTL-get the time to live in seconds of a keySELECTindexSelect the DB with the specified indexMOVEkey dbindexMove the key from the currently selected DB to thedbindex DBFLUSHDB-Remove all the keys from the currently selected DBFLUSHALL-Remove all the keys from all the databasesCommands operating on string values
CommandParametersDescriptionSETkey valueSet a key to a string valueGETkeyReturn the string value of the keyGETSETkey valueSet a key to a string returning the old value of the keySETNXkey valueSet a key to a string value if the key does not existSETEXkey time valueSet+Expire combo commandSETBITkey offset valueSet bit at offset to valueGETBITkey offsetReturn bit value at offsetMSETkey1 value1 key2 value2 ...keyN valueNSet multiple keys to multiple values in a single atomic operationMSETNXkey1 value1 key2 value2 ...keyN valueNSet multiple keys to multiple values in a single atomic operation if none of the keys already existMGETkey1 key2 ... keyNMulti-get, return the strings values of the keysINCRkeyIncrement the integer value of keyINCRBYkey integerIncrement the integer value of key by integerDECRkeyDecrement the integer value of keyDECRBYkey integerDecrement the integer value of key by integerAPPENDkey valueAppend the specified string to the string stored at keySUBSTRkey start endReturn a substring of a larger stringCommands operating on lists
CommandParametersDescriptionRPUSHkey valueAppend an element to the tail of the List value at keyLPUSHkey valueAppend an element to the head of the List value at keyLLENkeyReturn the length of the List value at keyLRANGEkey start endReturn a range of elements from the List at keyLTRIMkey start endTrim the list at key to the specified range of elementsLINDEXkey indexReturn the element at index position from the List at keyLSETkey index valueSet a new value as the element at index position of the List at keyLREMkey count valueRemove the first-N, last-N, or all the elements matching value from the List at keyLPOPkeyReturn and remove (atomically) the first element of the List at keyRPOPkeyReturn and remove (atomically) the last element of the List at keyBLPOPkey1 key2 ... keyN timeoutBlocking LPOPBRPOPkey1 key2 ... keyN timeoutBlocking RPOPRPOPLPUSHsrckey dstkeyReturn and remove (atomically) the last element of the source List stored atsrckey and push the same element to the destination List stored atdstkeyBRPOPLPUSHsrckey dstkeyLike RPOPLPUSH but blocking of source key is emptyCommands operating on sets
CommandParametersDescriptionSADDkey memberAdd the specified member to the Set value at keySREMkey memberRemove the specified member from the Set value at keySPOPkeyRemove and return (pop) a random element from the Set value at keySMOVEsrckey dstkey memberMove the specified member from one Set to another atomicallySCARDkeyReturn the number of elements (the cardinality) of the Set at keySISMEMBERkey memberTest if the specified value is a member of the Set at keySINTERkey1 key2 ... keyNReturn the intersection between the Sets stored at key1, key2, ..., keyNSINTERSTOREdstkey key1 key2 ... keyNCompute the intersection between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkeySUNIONkey1 key2 ... keyNReturn the union between the Sets stored at key1, key2, ..., keyNSUNIONSTOREdstkey key1 key2 ... keyNCompute the union between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkeySDIFFkey1 key2 ... keyNReturn the difference between the Set stored at key1 and all the Sets key2, ..., keyNSDIFFSTOREdstkey key1 key2 ... keyNCompute the difference between the Set key1 and all the Sets key2, ..., keyN, and store the resulting Set at dstkeySMEMBERSkeyReturn all the members of the Set value at keySRANDMEMBERkeyReturn a random member of the Set value at keyCommands operating on sorted zsets (sorted sets)
CommandParametersDescriptionZADDkey score memberAdd the specified member to the Sorted Set value at key or update the score if it already existZREMkey memberRemove the specified member from the Sorted Set value at keyZINCRBYkey increment memberIf the member already exists increment its score byincrement, otherwise add the member settingincrement as scoreZRANKkey memberReturn the rank (or index) or member in the sorted set at key, with scores being ordered from low to highZREVRANKkey memberReturn the rank (or index) or member in the sorted set at key, with scores being ordered from high to lowZRANGEkey start endReturn a range of elements from the sorted set at keyZREVRANGEkey start endReturn a range of elements from the sorted set at key, exactly like ZRANGE, but the sorted set is ordered in traversed in reverse order, from the greatest to the smallest scoreZRANGEBYSCOREkey min maxReturn all the elements with score >= min and score <= max (a range query) from the sorted setZCOUNTkey min maxReturn the number of elements with score >= min and score <= max in the sorted setZCARDkeyReturn the cardinality (number of elements) of the sorted set at keyZSCOREkey elementReturn the score associated with the specified element of the sorted set at keyZREMRANGEBYRANKkey min maxRemove all the elements with rank >= min and rank <= max from the sorted setZREMRANGEBYSCOREkey min maxRemove all the elements with score >= min and score <= max from the sorted setZUNIONSTORE / ZINTERSTOREdstkey N key1 ... keyN WEIGHTSw1 ...wN AGGREGATE SUM|MIN|MAXPerform a union or intersection over a number of sorted sets with optional weight and aggregateCommands operating on hashes
CommandParametersDescriptionHSETkey field valueSet the hash field to the specified value. Creates the hash if needed.HGETkey fieldRetrieve the value of the specified hash field.HMGETkey field1 ... fieldNGet the hash values associated to the specified fields.HMSETkey field1 value1 ... fieldN valueNSet the hash fields to their respective values.HINCRBYkey field integerIncrement the integer value of the hash atkey onfield withinteger.HEXISTSkey fieldTest for existence of a specified field in a hashHDELkey fieldRemove the specified field from a hashHLENkeyReturn the number of items in a hash.HKEYSkeyReturn all the fields in a hash.HVALSkeyReturn all the values in a hash.HGETALLkeyReturn all the fields and associated values in a hash.Sorting
CommandParametersDescriptionSORTkey BY pattern LIMITstart end GETpattern ASC|DESC ALPHASort a Set or a List accordingly to the specified parametersTransactions
CommandParametersDescriptionMULTI/EXEC/DISCARD/WATCH/UNWATCH-Redis atomic transactionsPublish/Subscribe
CommandParametersDescriptionSUBSCRIBE/UNSUBSCRIBE/PUBLISH-Redis Public/Subscribe messaging paradigm implementationPersistence control commands
CommandParametersDescriptionSAVE-Synchronously save the DB on diskBGSAVE-Asynchronously save the DB on diskLASTSAVE-Return the UNIX time stamp of the last successfully saving of the dataset on diskSHUTDOWN-Synchronously save the DB on disk, then shutdown the serverBGREWRITEAOF-Rewrite the append only file in background when it gets too bigRemote server control commands
CommandParametersDescriptionINFO-Provide information and statistics about the serverMONITOR-Dump all the received requests in real timeSLAVEOF-Change the replication settingsCONFIG-Configure a Redis server at runtime- [Redis学习笔记]-Redis命令
- redis命令学习
- Redis命令学习
- redis系统学习--命令
- redis命令,学习笔记
- redis命令学习笔记
- redis基本命令学习
- redis基本命令学习
- Redis命令学习
- redis命令学习之redis键
- redis学习之redis命令01
- redis 字符串命令学习1
- redis系统学习-string命令
- 学习redis基础命令网站
- redis学习之一基本命令
- Redis 学习之操作命令
- Redis学习二(命令)
- redis学习教程基本命令
- rtp proxy,media proxy超高效媒体服务器开发技术
- DES/3DES/AES区别
- 让IE6也支持max-width/height和min-width/height(完美解决方案)
- Flex Spark List with custom scroll bar and itemrenderer
- Log4j.properties配置详解
- redis命令学习
- 线程范围类的共享数据
- 特殊场合
- 保护眼睛的电脑设置
- java之静态(static)总结
- 安卓应用自动化测试工具
- Django groundwork在Django1.4以上的版本的问题解决 .
- m、mm、mmm命令差异
- NFC简介