Redis Common Commands

Source: Internet
Author: User

Info Server basic Information

Monitor live dump of received requests

FLUSHDB emptying the current database

Flushall emptying all databases

Quit close Connection

Save keeps data synchronized to disk

Bgsave Asynchronous

Lastsave returns the last timestamp that successfully saved data to disk

Shundown keeping data synchronized to disk and shutting down services

Set key value to add data

Get key to get data

exists key data is present

Keys <key match > Blur lookup data//*/? */?*? such as

Expire key time (in seconds) set data expiration

Persist key cancels data expiration time

TTL key gets the data remaining expiration time (which can also exist)

Number of keys in the Dbsize database

Del key deletes the data for the specified key

Type key returns key corresponding to value

Randomkey randomly returns a key that already exists

Data is of type string

Set key value to add data

Get key to get data

Getset key value Gets the value of key and assigns a new value

Mset key1 value1 ... keyN valuen Bulk Add data

Mget key1 Key2......keyn Get multiple data

Msetnx key1 value1 ... keyN valuen the value of all keys is not present, add all, and do nothing if a key already exists

Setex Key Time value adds a data with an expiration date

INCR key key exists then +1 operation, does not exist add data value to "1"

Incrby key num Key exists then +num operation, does not exist add data value to "num"

DECR key-1-1

Decrby Key Num-num-num

The value of the above four instruction key must be a string type number according to the observation record is to repeat the operation in 1 units, such as +1 will operate two times, but DECR will show negative number of operations

Append key value stitching value on key

SUBSTR Key Start end returns the value of key from start to the end of the substring, but does not modify the value of key start and end represent the subscript index of the string 0.

The above two instructions and the concatenation of string in Java, the same as according to observation record append also need to operate two times

  

Redis Common Commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.