当前位置:网站首页>Redis (II) - redis General Command

Redis (II) - redis General Command

2022-07-07 06:24:00 yutao_ five hundred and seventeen

Redis General Command

KEYS: Check all that match the template key, Don't mind using it on production equipment .

adopt help[command] You can check the specific usage of a command . for example

 Insert picture description here

SET Insert a key value pair of string type

 Insert picture description here

MSET Insert multiple key value pairs of string type

 Insert picture description here

DEL Delete specified KEY

 Insert picture description here

EXISTS Judge KEY Whether there is

 Insert picture description here

EXPIRE Give me a KEY Set expiration date . When the validity period expires ,KEY Automatically delete

TTL View one KEY The remaining validity period of

ttl Return value

 Greater than or equal to 0 The integer of : Key remaining expiration time 
-1: No expiration time set 
-2: The key doesn't exist 

 Insert picture description here

DBSIZE Total number of keys

 Insert picture description here

TYPE The data structure type of the key

 Insert picture description here

GET according to key obtain string Type of value
INCR Let an integer key Self increasing 1
INCRBY Let an integer key Increment the specified step
INCRBYFLOAT Let a floating-point key Increment the specified step
INCRBYFLOAT Let a floating-point key Increment the specified step

 Insert picture description here

 Insert picture description here

SETNX: Add one String Key value pairs of type , The premise is this key non-existent , Otherwise, do not execute .
SETEX: Add one String Key value pairs of type , And specify the validity period .

 Insert picture description here

 Insert picture description here

原网站

版权声明
本文为[yutao_ five hundred and seventeen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070141147403.html