Redis string command

Source: Internet
Author: User

?

?

Command

Explain

APPEND key value

If key already exists and is a string, the APPEND command appends value to the end of the original value of the key.

If key does not exist, APPEND simply sets the given key to value as if it were executing set key value.

Set key value

Assigns value to key.

Setnx Key value

Ibid., if key already exists, returns 0. NX is the meaning of not exist.

Translator: If key is not exist and then set key value.

Get key

Gets the value of the key. Does not exist return nil

Getset Key value

Sets the value of key and returns the old value.

Mget key1 Key2 ... KeyN

Read the value of more than one key at a time. If the corresponding key does not exist, the corresponding nil is returned.

Mset key1 value1 ... keyN valuen

Setting the value of multiple keys at once, successfully returning 1 means that all values are set, and a failure return of 0 means that no value is set

Msetnx key1 value1 ... keyN valuen

Ditto, but does not overwrite the existing key.

INCR key

Self-increment 1 for key

DECR key

Self-minus 1 for key

Incrby Key Integer

increase by a certain length

Decrby Key Integer

Reduce by a certain length

SUBSTR Key Start end

The subscript starts with 0 and gets the substring of the key.

Redis string command

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.