Redis key-Value related commands

Source: Internet
Author: User
Tags delete key

1. Keys

Format: Keys {pattern}

Returns all keys that satisfy the given pattern.


2. Exists

Format: Exists ' key '

Determine if key exists.


3. Del

Format: Del ' key '

Delete key.


4. Expire

Format: Expire ' key ' {num}

Set the expiration time on the key, the key must be present, num is seconds.


5. Persist

Format: Persist ' key '

The expiration time of the cancel key must be present.


6. TTL

Format: TTL ' key '

Get the remaining length of the key.


7. Select

Format: select {num}

Select the database, NUM has a value range of 0-15, by default there are 16 databases.


8. Move

Format: Move ' key ' {num}

Move the key to the NUM database.


9. Randomkey

Format: Randomkey

Randomly returns a key in the database.


Ten. Rename

Format: Rename ' key1 ' Key2 '

Rename the Key1 to Key2.


One. Type

Format: type ' key '

Returns the data type of key.


Dbsize.

Format: dbsize

Returns the number of keys in the current database.


Flushdb.

Format: FLUSHDB

Deletes all keys in the current database.


Flushall.

Format: Flushall

Delete all the keys in all databases.




This article is from the "Bronze Gong" blog, please be sure to keep this source http://jaeger.blog.51cto.com/11064196/1772297

Redis key-Value related 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.