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 of NoSQL (common commands)

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Keys

(1) introduction: returns all key that meet the conditions. Regular rules are supported.

(2) Syntax: keys key

(3) for example:

Exists

(1) introduction: confirm whether a key exists. If it exists, it returns 0. If it does not exist, it returns 1.

(2) Syntax: exists key

(3) for example:

Del

(1) introduction: delete a key

(2) Syntax: del key

(3) for example:

Rename

(1) introduction: renaming key

(2) Syntax: rename old_key new_key

(3) for example:

Type

(1) introduction: get the type of return value

(2) Syntax: type key

(3) for example:

The life cycle of key

(1) introduction: Redis is more often used as a cache in actual use, but the cached data generally needs to be set for survival time, that is, data is destroyed after expiration.

(2) grammar:

EXPIRE key seconds sets the time to live of key (in seconds). How many seconds will key delete automatically?

TTL key to see how long key was born.

PERSIST key clear time to Live

PEXPIRE key milliseconds time to live is set in milliseconds

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