SCANIterate the keyspace incrementally: each call walks ~COUNT buckets of one shard and returns the next cursor.
| 構文 | SCAN cursor [MATCH pattern] [COUNT count] [TYPE type] |
| グループ | scan |
| 引数の数 | -2 |
| 導入バージョン | 4.0.0 |
| フラグ | readonly |
| 計算量 | O(COUNT) buckets per call, amortised O(N) for a full sweep — reverse-binary cursor, rehash-tolerant (a key present for the whole sweep is returned at least once even across table growth) |
| Redis 互換性 | differs: cursors encode (shard, position), so a cursor is only valid on the server and shard count that issued it — the same per-node property Redis Cluster cursors have. MATCH and TYPE filter after collection; COUNT bounds the buckets visited, not the keys returned |