Redis Key Command

Source: Internet
Author: User
Tags delete key time 0

?

Redis Key Command

? ?

del key1 key2 ... keyn span>

Delete key is Key1,key2...keyn, space delimited.

persist key

Removes the lifetime of a given key from" volatile "(with time-to-live key) to" persistent "( A key that does not have a lifetime and never expires).

expire key seconds

Pexpire key milliseconds

This command works similarly to the EXPIRE command, but it sets the lifetime of the key in milliseconds, rather than the EXPIRE command, in seconds.

Exists key

Is there a key

keys pattern

keys * matches all keys in the database.

keys H?llo matches Hello, Hallo, Hxllo, and so on.

keys H*llo matches Hllo, Heeeeello, and so on.

keys H[ae]llo matches hello and Hallo, but does not match Hillo.

special symbol with \ separate

Type key

Returns the type of key.

None,string,list,set,zset,hash

Randomkey

Randomly returns a key

Rename oldkey Newkey

Renaming

Dbsize

Returns the number of keys in the database

TTL key

For the key that has the expiration time set, the calculation is how long it will expire, in seconds.

Pttl Key

This command is similar to the TTL command, but it returns the remaining lifetime of the key in milliseconds, rather than in seconds, as in the case of the TTL command.

Select Db-index

Select the database by index, the default connection database is all 0, the default number of databases is 16. Returns 1 indicates success, 0 failed

Move Key Db-index

Move key from the current database to the specified database

Flushdb

Delete all keys in the current database, this method does not fail

Flushall

Remove all keys from all databases, this method does not fail

Sort

Http://redisdoc.com/key/sort.html

?

?

Redis Key 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.