Redis key-Value related commands

Source: Internet
Author: User

Key-Value Related commands



Keys * Returns all keys keys my*

exists Mykey1 whether there is a mykey1 key

Del MyKey Delete MyKey key


Expire MyKey 10 setting MyKey key expiration time is 10 seconds


TTL MyKey get MyKey Expiration time (constantly changing),-1 means has expired, expired is destroyed, if not set expiration time, default is-1



Redis defaults to 16 databases, from 0-15.


Default is 0 database

Select 1 Choose 1 Database


Move age 1 moves age to 1 database


Persist Age cancellation Expiration setting


Radomkey randomly returns a key


Rename Key1 key2 rename Key1 to Key2, if Key2 exists, it will overwrite


Type Key1 returns the data types of Key1


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.