Redis Learning Lesson Seventh: Key-value commands and server commands

Source: Internet
Author: User
Tags redis server

Redis Key-Value related commands

keys: Returns all keys that satisfy the given pattern. (Usage: Keys pattern expression)

exists: Verify that a key exists. (Usage: Exists key)

del: Delete a key. (Usage: Del key)

expire: Sets the expiration time for a key. (Usage: Expire key seconds) may be used to obtain the valid duration of this key through the TTL key until 1 indicates that the value has expired.

Move: Transfers the key from the current database to a different database. (Usage: Move key database name)

persist: Removes the expiration time for a given key. (Usage: Persist key)

randomkey: Randomly returns a key in the key space. (Usage: randomkey)

rename: Rename key. (Usage: rename Oldkey newkey)

Type: Returns the kind of the value. (Usage: Type key)

Redis Server-related commands

Ping: Tests if the connection is alive.

echo: Print some content at the command line. (Usage: Echo to print the content)

Select: Choose a database. The Redis database number enters the 0 database from 0~15,redis by default. We can select any database to access the data. (Usage: Select database number)

quit: Exits the connection.

dbsize: Returns the number of keys in the current database.

Info: Gets the information and statistics of the server.

config get: real-time upload of received requests. such as: Config get dir. If you want to get the configuration values for all the parameter data, simply execute "config get *" To display all the values.

flushdb: Deletes all keys in the currently selected database.

flushall: Removes all keys from all databases.

Redis Learning Lesson Seventh: Key-value commands and server 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.