java redis hscan_如何在Redis中使用HSCAN命令?
生活随笔
收集整理的這篇文章主要介紹了
java redis hscan_如何在Redis中使用HSCAN命令?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
命令
使用以下命令啟動完整哈希掃描
HSCAN myhash 0
使用與模式匹配的字段開始哈希掃描:
HSCAN myhash 0 MATCH order_ *
使用與模式匹配的字段啟動哈希掃描,并強制掃描命令執行更多掃描:
HSCAN myhash 0 MATCH order_ * COUNT 1000
注意
不要忘記MATCH每次迭代都可以返回很少甚至沒有元素,如documentation中所述:
It is important to note that the MATCH filter is applied after
elements are retrieved from the collection, just before returning data
to the client. This means that if the pattern matches very little
elements inside the collection, SCAN will likely return no elements in
most iterations.
這就是為什么你可以使用COUNT強制每次迭代進行更多掃描.
[更新]如果指定了Didier Spezia,您需要Redis 2.8才能使用* SCAN命令.
總結
以上是生活随笔為你收集整理的java redis hscan_如何在Redis中使用HSCAN命令?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 临床试验中的指标敏感性、特异性
- 下一篇: SocksCap64全局代理工具使用+C