Redis索引值相關命令

來源:互聯網
上載者:User

標籤:redis索引值相關命令

1. keys

格式:keys {pattern}

返回滿足給定pattern的所有key。


2. exists

格式:exists ‘key‘

判斷key是否存在。


3. del

格式:del ‘key‘

刪除key。


4. expire

格式:expire ‘key‘ {num}

對鍵設定到期時間,鍵必須存在,num為秒。


5. persist

格式:persist ‘key‘

取消鍵的到期時間,鍵必須存在。


6. ttl

格式:ttl ‘key‘

獲得key剩餘時間長度。


7. select

格式:select {num}

選擇資料庫,num取值範圍為0-15,預設總共有16個資料庫。


8. move

格式:move ‘key‘ {num}

把key移動到第num個資料庫。


9. randomkey

格式:randomkey

隨機返回資料庫中的一個key。


10. rename

格式:rename ‘key1‘ ‘key2‘

把key1重新命名為key2。


11. type

格式:type ‘key‘

返回key的資料類型。


12. dbsize

格式:dbsize

返回當前資料庫key的個數。


13. flushdb

格式:flushdb

刪除當前資料庫中所有的key。


14. flushall

格式:flushall

刪除所有資料庫中所有的key。




本文出自 “銅鑼衛門” 部落格,請務必保留此出處http://jaeger.blog.51cto.com/11064196/1772297

Redis索引值相關命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.