Redis學習---Redis操做之其餘操做

全局有效的其餘操做html

save
強制將內存/緩存中的key刷到硬盤上

image

-------------------------------------------------------------------------------------------------------------------------------------- redis

delete(*names)
# 根據刪除redis中的任意數據類型

image

-------------------------------------------------------------------------------------------------------------------------------------- sql

keys(pattern='*')
# 根據模型獲取redis的name  # 更多:     # KEYS * 匹配數據庫中全部 key 。     # KEYS h?llo 匹配 hello , hallo 和 hxllo 等。     # KEYS h*llo 匹配 hllo 和 heeeeello 等。     # KEYS h[ae]llo 匹配 hello 和 hallo ,但不匹配 hillo

image

-------------------------------------------------------------------------------------------------------------------------------------- 數據庫

exists(name)
# 檢測redis的name是否存在

image

-------------------------------------------------------------------------------------------------------------------------------------- 緩存

expire(name ,time)
# 爲某個redis的某個name設置超時時間

image

-------------------------------------------------------------------------------------------------------------------------------------- dom

rename(src, dst)
# 對redis的name重命名爲

-------------------------------------------------------------------------------------------------------------------------------------- 3d

move(name, db))
# 將redis的某個值移動到指定的db下,同時刪除源庫的key

image

-------------------------------------------------------------------------------------------------------------------------------------- code

randomkey()
# 隨機獲取一個redis的name(不刪除)

image

-------------------------------------------------------------------------------------------------------------------------------------- htm

type(name)
# 獲取name對應值的類型

image

-------------------------------------------------------------------------------------------------------------------------------------- blog

scan(cursor=0, match=None, count=None)
scan_iter(match=None, count=None)
# 同字符串操做,用於增量迭代獲取key

image

相關文章
相關標籤/搜索