天天看點

redis transaction和connection指令操作

/*********** redis transaction指令操作 **********/

1.

discard -

summary: discard all commands issued after multi

since: 2.0.0

exec -

summary: execute all commands issued after multi

since: 1.2.0

multi -

summary: mark the start of a transaction block

unwatch -

summary: forget about all watched keys

since: 2.2.0

watch key [key ...]

summary: watch the given keys to determine execution of the multi/exec block

/************** redis connection指令操作 ***********/

1.驗證伺服器密碼

auth password

summary: authenticate to the server

since: 1.0.0

2.顯示指定的message資訊

echo message

summary: echo the given string

3.判斷服務是否ping通

ping -

summary: ping the server

4.關閉連接配接并退出

quit -

summary: close the connection

5.選擇redis下的資料庫

select index

summary: change the selected database for the current connection