Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis basic command

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Get a list of key names that match the rules

Keys pattern

Symbolic meaning? Match a character * matches any number of characters [] matches any character between parentheses, and you can use the "-" symbol to indicate a range\ x matching character x, which is used to escape symbols. If you want to match? You need to use\?

Note: the kyes command needs to traverse all the keys in the Redis, which can affect performance when there are a large number of keys, and is not recommended in a production environment.

two。 Determine whether a key exists or not

Exists key

Returns integer type 1 if the key exists, otherwise 0

3. Delete key

Redis > DEL key [key...]

You can delete one or more keys, and the return value is the number of keys deleted.

4. Get the data type of the key value

Type key

The data type used by the type command to get the key value, and the return value may be string hash list set zset

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report