Redis常用命令
1、keys 回傳滿足給定pattern的所有key ,例keys * 匹配所有,keys my* 匹配以my開頭的所有key
2、 exists 確認一個key是否存在, exists key 例 :exists age 存在回傳1 不存在回傳0
3、del 洗掉一個key del age 洗掉age
4、expire 設定一個key的過期時間 expire addr 10 設定國企時間為10s
5、ttl 查看一個key的過期時間, ttl addr
6、move 將當前資料庫中的key轉移到其他資料庫中,move age 1 (move key 資料庫(0-15))
7、select 數字(0-15)選擇資料庫 ,select 資料庫:select 1,回傳ok成功
8、persist 移除給定key的過期時間,expire age 100 ===> ttl age ===> persist age ===> ttl age => -1,
9、randomkey 隨機回傳key空間的一個key,
10、rename 重命名key,rename age new_age
11、type 回傳值得型別 type age
12、 dbsize 回傳當前資料庫中key的數目,
13、info獲取服務器的資訊和統計
14、config get 獲取服務器的配置資訊,config get dir 獲取dir引數資訊,config get * 獲取所有配置資訊
15、flushdb 洗掉當前選擇資料中所有的key
16、flushall 洗掉所有資料庫中所有的key
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/259688.html
標籤:其他
上一篇:Redis入門到超神 - 01 Redis介紹與安裝
下一篇:期貨因子分析(六)
