@enjoys/context-engine 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +214 -62
  2. package/data/codeActions/css.json +119 -111
  3. package/data/codeActions/dart.json +190 -31
  4. package/data/codeActions/nestjs.json +124 -124
  5. package/data/codeActions/r.json +69 -71
  6. package/data/codeActions/sb.json +2 -2
  7. package/data/codeActions/scala.json +154 -26
  8. package/data/codeActions/shadcn.json +112 -112
  9. package/data/codeActions/shell.json +2 -2
  10. package/data/codeActions/tailwindcss.json +83 -76
  11. package/data/codeLens/abap.json +4 -2
  12. package/data/codeLens/angular.json +141 -22
  13. package/data/codeLens/apex.json +4 -2
  14. package/data/codeLens/awk.json +2 -2
  15. package/data/codeLens/azcli.json +4 -3
  16. package/data/codeLens/bicep.json +4 -2
  17. package/data/codeLens/c.json +4 -4
  18. package/data/codeLens/caddy.json +2 -2
  19. package/data/codeLens/cameligo.json +4 -2
  20. package/data/codeLens/clojure.json +4 -2
  21. package/data/codeLens/coffee.json +4 -2
  22. package/data/codeLens/crontab.json +2 -2
  23. package/data/codeLens/doctest.json +4 -3
  24. package/data/codeLens/ecl.json +4 -2
  25. package/data/codeLens/elixir.json +4 -2
  26. package/data/codeLens/flow9.json +4 -2
  27. package/data/codeLens/freemarker2.json +4 -2
  28. package/data/codeLens/hcl.json +4 -4
  29. package/data/codeLens/html.json +4 -4
  30. package/data/codeLens/julia.json +4 -2
  31. package/data/codeLens/less.json +4 -2
  32. package/data/codeLens/lexon.json +4 -2
  33. package/data/codeLens/liquid.json +4 -2
  34. package/data/codeLens/lua.json +4 -4
  35. package/data/codeLens/m3.json +4 -2
  36. package/data/codeLens/mdx.json +4 -2
  37. package/data/codeLens/mips.json +4 -2
  38. package/data/codeLens/msdax.json +4 -2
  39. package/data/codeLens/mysql.json +4 -2
  40. package/data/codeLens/nginx.json +4 -4
  41. package/data/codeLens/objective-c.json +4 -2
  42. package/data/codeLens/pascal.json +4 -2
  43. package/data/codeLens/pascaligo.json +4 -2
  44. package/data/codeLens/pgsql.json +4 -2
  45. package/data/codeLens/pla.json +4 -3
  46. package/data/codeLens/postiats.json +4 -2
  47. package/data/codeLens/powerquery.json +4 -2
  48. package/data/codeLens/qsharp.json +4 -2
  49. package/data/codeLens/razor.json +4 -2
  50. package/data/codeLens/redshift.json +4 -2
  51. package/data/codeLens/restructuredtext.json +4 -2
  52. package/data/codeLens/sb.json +4 -2
  53. package/data/codeLens/scheme.json +4 -2
  54. package/data/codeLens/scss.json +4 -2
  55. package/data/codeLens/shadcn.json +117 -89
  56. package/data/codeLens/shell.json +4 -2
  57. package/data/codeLens/sol.json +4 -2
  58. package/data/codeLens/sparql.json +4 -2
  59. package/data/codeLens/st.json +4 -2
  60. package/data/codeLens/systemverilog.json +4 -2
  61. package/data/codeLens/tcl.json +4 -2
  62. package/data/codeLens/twig.json +4 -2
  63. package/data/codeLens/vb.json +4 -2
  64. package/data/codeLens/wgsl.json +4 -2
  65. package/data/codeLens/xml.json +4 -4
  66. package/data/commands/ab.json +80 -0
  67. package/data/commands/act.json +82 -0
  68. package/data/commands/age.json +68 -0
  69. package/data/commands/argocd.json +109 -0
  70. package/data/commands/asdf.json +102 -0
  71. package/data/commands/astro.json +106 -0
  72. package/data/commands/at.json +52 -0
  73. package/data/commands/babel.json +83 -0
  74. package/data/commands/buildah.json +105 -0
  75. package/data/commands/cabal.json +114 -0
  76. package/data/commands/cdk.json +127 -0
  77. package/data/commands/changeset.json +68 -0
  78. package/data/commands/checkov.json +75 -0
  79. package/data/commands/commitlint.json +60 -0
  80. package/data/commands/concurrently.json +62 -0
  81. package/data/commands/conventional-commits.json +30 -0
  82. package/data/commands/cosign.json +103 -0
  83. package/data/commands/crane.json +109 -0
  84. package/data/commands/cron.json +29 -0
  85. package/data/commands/crystal.json +102 -0
  86. package/data/commands/csvkit.json +96 -0
  87. package/data/commands/cut.json +62 -0
  88. package/data/commands/df.json +66 -0
  89. package/data/commands/diff.json +72 -0
  90. package/data/commands/dig.json +67 -0
  91. package/data/commands/dmesg.json +65 -0
  92. package/data/commands/dotnet.json +136 -0
  93. package/data/commands/du.json +71 -0
  94. package/data/commands/echo.json +45 -0
  95. package/data/commands/eksctl.json +101 -0
  96. package/data/commands/eleventy.json +73 -0
  97. package/data/commands/entr.json +50 -0
  98. package/data/commands/env.json +43 -0
  99. package/data/commands/erlang.json +76 -0
  100. package/data/commands/esbuild.json +91 -0
  101. package/data/commands/ffmpeg.json +115 -0
  102. package/data/commands/fnm.json +100 -0
  103. package/data/commands/free.json +63 -0
  104. package/data/commands/func.json +89 -0
  105. package/data/commands/gatsby.json +106 -0
  106. package/data/commands/ghc.json +79 -0
  107. package/data/commands/ghostscript.json +77 -0
  108. package/data/commands/git-lfs.json +95 -0
  109. package/data/commands/gpg.json +112 -0
  110. package/data/commands/grafana-cli.json +97 -0
  111. package/data/commands/grpcurl.json +74 -0
  112. package/data/commands/grype.json +75 -0
  113. package/data/commands/hadolint.json +61 -0
  114. package/data/commands/head.json +48 -0
  115. package/data/commands/hexo.json +101 -0
  116. package/data/commands/hey.json +91 -0
  117. package/data/commands/hostname.json +52 -0
  118. package/data/commands/httpie.json +101 -0
  119. package/data/commands/hugo.json +106 -0
  120. package/data/commands/husky.json +52 -0
  121. package/data/commands/id.json +50 -0
  122. package/data/commands/ifconfig.json +47 -0
  123. package/data/commands/imagemagick.json +117 -0
  124. package/data/commands/inotifywait.json +70 -0
  125. package/data/commands/ip.json +103 -0
  126. package/data/commands/istioctl.json +105 -0
  127. package/data/commands/javac.json +87 -0
  128. package/data/commands/jekyll.json +105 -0
  129. package/data/commands/kill.json +57 -0
  130. package/data/commands/killall.json +60 -0
  131. package/data/commands/kind.json +98 -0
  132. package/data/commands/ko.json +89 -0
  133. package/data/commands/kustomize.json +70 -0
  134. package/data/commands/latex.json +65 -0
  135. package/data/commands/lerna.json +125 -0
  136. package/data/commands/ln.json +54 -0
  137. package/data/commands/lsof.json +69 -0
  138. package/data/commands/manifest.json +1 -1
  139. package/data/commands/miller.json +58 -0
  140. package/data/commands/mise.json +107 -0
  141. package/data/commands/mix.json +128 -0
  142. package/data/commands/mkdir.json +43 -0
  143. package/data/commands/mount.json +63 -0
  144. package/data/commands/nc.json +71 -0
  145. package/data/commands/netstat.json +74 -0
  146. package/data/commands/nim.json +104 -0
  147. package/data/commands/nohup.json +28 -0
  148. package/data/commands/nslookup.json +46 -0
  149. package/data/commands/nvm.json +91 -0
  150. package/data/commands/ocaml.json +68 -0
  151. package/data/commands/opam.json +111 -0
  152. package/data/commands/pandoc.json +100 -0
  153. package/data/commands/parallel.json +73 -0
  154. package/data/commands/patch.json +55 -0
  155. package/data/commands/ping.json +73 -0
  156. package/data/commands/podman.json +151 -0
  157. package/data/commands/postman.json +82 -0
  158. package/data/commands/pre-commit.json +101 -0
  159. package/data/commands/prometheus.json +65 -0
  160. package/data/commands/pyenv.json +87 -0
  161. package/data/commands/q.json +63 -0
  162. package/data/commands/rbenv.json +85 -0
  163. package/data/commands/rebar3.json +110 -0
  164. package/data/commands/remix.json +80 -0
  165. package/data/commands/rollup.json +74 -0
  166. package/data/commands/route.json +53 -0
  167. package/data/commands/rustc.json +90 -0
  168. package/data/commands/sam.json +122 -0
  169. package/data/commands/sdkman.json +89 -0
  170. package/data/commands/semantic-release.json +58 -0
  171. package/data/commands/semgrep.json +97 -0
  172. package/data/commands/serverless.json +121 -0
  173. package/data/commands/shellcheck.json +61 -0
  174. package/data/commands/skopeo.json +79 -0
  175. package/data/commands/socat.json +43 -0
  176. package/data/commands/sops.json +85 -0
  177. package/data/commands/sort.json +75 -0
  178. package/data/commands/sqlite-utils.json +109 -0
  179. package/data/commands/ss.json +75 -0
  180. package/data/commands/stack.json +115 -0
  181. package/data/commands/storybook.json +90 -0
  182. package/data/commands/strace.json +71 -0
  183. package/data/commands/svelte.json +89 -0
  184. package/data/commands/swc.json +73 -0
  185. package/data/commands/swiftc.json +83 -0
  186. package/data/commands/syft.json +77 -0
  187. package/data/commands/tail.json +58 -0
  188. package/data/commands/tee.json +38 -0
  189. package/data/commands/tflint.json +83 -0
  190. package/data/commands/touch.json +57 -0
  191. package/data/commands/traceroute.json +70 -0
  192. package/data/commands/tracert.json +49 -0
  193. package/data/commands/umount.json +49 -0
  194. package/data/commands/uniq.json +59 -0
  195. package/data/commands/vagrant.json +112 -0
  196. package/data/commands/vegeta.json +59 -0
  197. package/data/commands/volta.json +87 -0
  198. package/data/commands/watch.json +58 -0
  199. package/data/commands/wc.json +50 -0
  200. package/data/commands/webpack.json +94 -0
  201. package/data/commands/which.json +34 -0
  202. package/data/commands/whoami.json +27 -0
  203. package/data/commands/wrangler.json +124 -0
  204. package/data/commands/wrk.json +63 -0
  205. package/data/commands/xargs.json +66 -0
  206. package/data/commands/xsv.json +119 -0
  207. package/data/commands/zig.json +114 -0
  208. package/data/completion/redis-cli.json +3465 -3405
  209. package/data/documentHighlight/nextjs.json +270 -212
  210. package/data/documentSymbol/azcli.json +6 -3
  211. package/data/documentSymbol/caddy.json +7 -4
  212. package/data/documentSymbol/crontab.json +6 -3
  213. package/data/documentSymbol/css.json +14 -14
  214. package/data/documentSymbol/doctest.json +6 -3
  215. package/data/documentSymbol/dotenv.json +6 -3
  216. package/data/documentSymbol/flow9.json +8 -4
  217. package/data/documentSymbol/graphql.json +1 -1
  218. package/data/documentSymbol/ini.json +6 -3
  219. package/data/documentSymbol/json.json +6 -3
  220. package/data/documentSymbol/lexon.json +6 -3
  221. package/data/documentSymbol/mips.json +6 -3
  222. package/data/documentSymbol/msdax.json +6 -3
  223. package/data/documentSymbol/pla.json +6 -3
  224. package/data/documentSymbol/powerquery.json +6 -3
  225. package/data/documentSymbol/restructuredtext.json +6 -3
  226. package/data/documentSymbol/sb.json +6 -3
  227. package/data/documentSymbol/sparql.json +6 -3
  228. package/data/documentSymbol/ssh_config.json +6 -3
  229. package/data/documentSymbol/systemd.json +6 -3
  230. package/data/documentSymbol/xml.json +6 -3
  231. package/data/hover/caddy.json +530 -458
  232. package/data/hover/dockerfile.json +355 -283
  233. package/data/hover/lua.json +1391 -971
  234. package/data/hover/nginx.json +957 -891
  235. package/data/hover/redis-cli.json +2168 -1088
  236. package/data/hover/sql.json +1405 -1273
  237. package/data/manifest.json +4 -6
  238. package/package.json +2 -2
@@ -1,1088 +1,2168 @@
1
- {
2
- "language": "redis-cli",
3
- "hovers": {
4
- "SET": {
5
- "contents": [
6
- {
7
- "value": "```redis\nSET key value [EX seconds] [PX ms] [EXAT ts] [PXAT ms-ts] [NX|XX] [KEEPTTL] [GET]\n```\n**SET** assigns a string value to a key. Options:\n- `EX`/`PX` — set TTL in seconds/milliseconds\n- `NX` — only set if key does **not** exist (distributed lock)\n- `XX` — only set if key **already** exists\n- `GET` — return the old value (Redis 6.2+)\n- `KEEPTTL` — retain existing TTL\n\n```redis\nSET session:abc \"token\" EX 3600 NX\nSET counter 0\nSET key val XX GET\n```\nTime complexity: **O(1)**"
8
- }
9
- ]
10
- },
11
- "GET": {
12
- "contents": [
13
- {
14
- "value": "```redis\nGET key\n```\n**GET** returns the string value of `key`. Returns `nil` if the key does not exist. Returns an error if the value is not a string.\n\n```redis\nSET greeting \"hello\"\nGET greeting # => \"hello\"\nGET nonexistent # => (nil)\n```\nTime complexity: **O(1)**"
15
- }
16
- ]
17
- },
18
- "MSET": {
19
- "contents": [
20
- {
21
- "value": "```redis\nMSET key1 value1 [key2 value2 ...]\n```\n**MSET** sets multiple key-value pairs atomically. Never fails — always OK.\n\n```redis\nMSET first \"Hello\" second \"World\"\nMGET first second # => \"Hello\" \"World\"\n```\nTime complexity: **O(N)** where N is the number of keys"
22
- }
23
- ]
24
- },
25
- "MGET": {
26
- "contents": [
27
- {
28
- "value": "```redis\nMGET key1 [key2 ...]\n```\n**MGET** returns values for all specified keys. Non-existing keys return `nil`.\n\n```redis\nMGET key1 key2 key3\n# => \"val1\" (nil) \"val3\"\n```\nTime complexity: **O(N)**"
29
- }
30
- ]
31
- },
32
- "INCR": {
33
- "contents": [
34
- {
35
- "value": "```redis\nINCR key\n```\n**INCR** atomically increments the integer stored at `key` by 1. If the key does not exist, it's set to 0 before incrementing. Returns the new value.\n\n```redis\nSET counter 10\nINCR counter # => 11\nINCR newcounter # => 1\n```\nTime complexity: **O(1)**. Common for counters, rate limiters."
36
- }
37
- ]
38
- },
39
- "INCRBY": {
40
- "contents": [
41
- {
42
- "value": "```redis\nINCRBY key increment\n```\n**INCRBY** atomically increments the integer at `key` by the given amount. Can be negative for decrements.\n\n```redis\nSET counter 10\nINCRBY counter 5 # => 15\nINCRBY counter -3 # => 12\n```\nTime complexity: **O(1)**"
43
- }
44
- ]
45
- },
46
- "DECR": {
47
- "contents": [
48
- {
49
- "value": "```redis\nDECR key\n```\n**DECR** atomically decrements the integer at `key` by 1.\n\n```redis\nSET counter 10\nDECR counter # => 9\n```\nTime complexity: **O(1)**"
50
- }
51
- ]
52
- },
53
- "APPEND": {
54
- "contents": [
55
- {
56
- "value": "```redis\nAPPEND key value\n```\n**APPEND** appends `value` to the existing string at `key`. Creates the key if it doesn't exist. Returns the length of the string after appending.\n\n```redis\nAPPEND mykey \"Hello\"\nAPPEND mykey \" World\"\nGET mykey # => \"Hello World\"\n```\nTime complexity: **O(1)** amortized"
57
- }
58
- ]
59
- },
60
- "STRLEN": {
61
- "contents": [
62
- {
63
- "value": "```redis\nSTRLEN key\n```\n**STRLEN** returns the length of the string stored at `key`. Returns 0 if the key doesn't exist.\n\n```redis\nSET mykey \"Hello World\"\nSTRLEN mykey # => 11\n```\nTime complexity: **O(1)**"
64
- }
65
- ]
66
- },
67
- "GETRANGE": {
68
- "contents": [
69
- {
70
- "value": "```redis\nGETRANGE key start end\n```\n**GETRANGE** returns a substring of the string at `key`. Negative offsets count from the end.\n\n```redis\nSET mykey \"Hello, World\"\nGETRANGE mykey 0 4 # => \"Hello\"\nGETRANGE mykey -5 -1 # => \"World\"\n```\nTime complexity: **O(N)** where N is the length of the returned string"
71
- }
72
- ]
73
- },
74
- "SETEX": {
75
- "contents": [
76
- {
77
- "value": "```redis\nSETEX key seconds value\n```\n**SETEX** sets `key` to `value` with an expiration in seconds. Atomic equivalent of `SET key value` + `EXPIRE key seconds`.\n\n```redis\nSETEX session 3600 \"data\"\nTTL session # => 3600\n```\nTime complexity: **O(1)**"
78
- }
79
- ]
80
- },
81
- "SETNX": {
82
- "contents": [
83
- {
84
- "value": "```redis\nSETNX key value\n```\n**SETNX** (SET if Not eXists) sets `key` to `value` only if it doesn't already exist. Returns 1 if set, 0 otherwise.\n\n```redis\nSETNX mykey \"Hello\" # => 1\nSETNX mykey \"World\" # => 0 (key exists)\n```\n**Note**: For distributed locks, prefer `SET key value NX EX seconds`.\nTime complexity: **O(1)**"
85
- }
86
- ]
87
- },
88
- "GETDEL": {
89
- "contents": [
90
- {
91
- "value": "```redis\nGETDEL key\n```\n**GETDEL** gets the value and deletes the key atomically (Redis 6.2+).\n\n```redis\nSET temp \"data\"\nGETDEL temp # => \"data\"\nGET temp # => (nil)\n```\nTime complexity: **O(1)**"
92
- }
93
- ]
94
- },
95
- "GETEX": {
96
- "contents": [
97
- {
98
- "value": "```redis\nGETEX key [EX seconds | PX ms | EXAT ts | PXAT ms-ts | PERSIST]\n```\n**GETEX** gets the value and optionally sets/removes its expiration (Redis 6.2+).\n\n```redis\nGETEX mykey EX 100 # Get and set 100s TTL\nGETEX mykey PERSIST # Get and remove TTL\n```\nTime complexity: **O(1)**"
99
- }
100
- ]
101
- },
102
- "INCRBYFLOAT": {
103
- "contents": [
104
- {
105
- "value": "```redis\nINCRBYFLOAT key increment\n```\n**INCRBYFLOAT** increments the floating point number stored at `key`.\n\n```redis\nSET price 10.50\nINCRBYFLOAT price 0.1 # => \"10.6\"\nINCRBYFLOAT price -5 # => \"5.6\"\n```\nTime complexity: **O(1)**"
106
- }
107
- ]
108
- },
109
- "LCS": {
110
- "contents": [
111
- {
112
- "value": "```redis\nLCS key1 key2 [LEN] [IDX] [MINMATCHLEN len] [WITHMATCHLEN]\n```\n**LCS** finds the Longest Common Substring between two string keys (Redis 7.0+).\n\n```redis\nSET key1 \"ohmytext\" \nSET key2 \"mynewtext\"\nLCS key1 key2 # => \"mytext\"\nLCS key1 key2 LEN # => 6\n```\nTime complexity: **O(N*M)** where N and M are string lengths"
113
- }
114
- ]
115
- },
116
- "HSET": {
117
- "contents": [
118
- {
119
- "value": "```redis\nHSET key field value [field value ...]\n```\n**HSET** sets field(s) in a hash. Creates the hash if it doesn't exist. Returns the number of new fields added.\n\n```redis\nHSET user:1 name \"Alice\" age \"30\" email \"alice@example.com\"\nHGET user:1 name # => \"Alice\"\n```\nTime complexity: **O(N)** where N is number of field-value pairs"
120
- }
121
- ]
122
- },
123
- "HGET": {
124
- "contents": [
125
- {
126
- "value": "```redis\nHGET key field\n```\n**HGET** returns the value of a field in a hash. Returns `nil` if field or key doesn't exist.\n\n```redis\nHSET user:1 name \"Alice\"\nHGET user:1 name # => \"Alice\"\nHGET user:1 missing # => (nil)\n```\nTime complexity: **O(1)**"
127
- }
128
- ]
129
- },
130
- "HGETALL": {
131
- "contents": [
132
- {
133
- "value": "```redis\nHGETALL key\n```\n**HGETALL** returns all fields and values in a hash as a flat list.\n\n```redis\nHSET user:1 name \"Alice\" age \"30\"\nHGETALL user:1\n# => 1) \"name\" 2) \"Alice\" 3) \"age\" 4) \"30\"\n```\n**Warning**: For large hashes, consider `HSCAN`.\nTime complexity: **O(N)**"
134
- }
135
- ]
136
- },
137
- "HDEL": {
138
- "contents": [
139
- {
140
- "value": "```redis\nHDEL key field [field ...]\n```\n**HDEL** removes fields from a hash. Returns the number of fields removed.\n\n```redis\nHDEL user:1 age email\n```\nTime complexity: **O(N)** where N is number of fields to remove"
141
- }
142
- ]
143
- },
144
- "HEXISTS": {
145
- "contents": [
146
- {
147
- "value": "```redis\nHEXISTS key field\n```\n**HEXISTS** checks if a field exists in a hash. Returns 1 if exists, 0 otherwise.\n\n```redis\nHEXISTS user:1 name # => 1\nHEXISTS user:1 missing # => 0\n```\nTime complexity: **O(1)**"
148
- }
149
- ]
150
- },
151
- "HMSET": {
152
- "contents": [
153
- {
154
- "value": "```redis\nHMSET key field value [field value ...]\n```\n**HMSET** sets multiple fields in a hash. **Deprecated** in favor of `HSET` which now accepts multiple field-value pairs.\n\n```redis\nHMSET user:1 name \"Alice\" age \"30\"\n```\nTime complexity: **O(N)**"
155
- }
156
- ]
157
- },
158
- "HMGET": {
159
- "contents": [
160
- {
161
- "value": "```redis\nHMGET key field [field ...]\n```\n**HMGET** returns values for multiple fields. Non-existing fields return `nil`.\n\n```redis\nHMGET user:1 name age missing\n# => \"Alice\" \"30\" (nil)\n```\nTime complexity: **O(N)**"
162
- }
163
- ]
164
- },
165
- "HINCRBY": {
166
- "contents": [
167
- {
168
- "value": "```redis\nHINCRBY key field increment\n```\n**HINCRBY** increments the integer value of a hash field. Creates the field with value 0 if it doesn't exist.\n\n```redis\nHINCRBY user:1 login_count 1\n```\nTime complexity: **O(1)**"
169
- }
170
- ]
171
- },
172
- "HLEN": {
173
- "contents": [
174
- {
175
- "value": "```redis\nHLEN key\n```\n**HLEN** returns the number of fields in a hash.\n\n```redis\nHLEN user:1 # => 3\n```\nTime complexity: **O(1)**"
176
- }
177
- ]
178
- },
179
- "HRANDFIELD": {
180
- "contents": [
181
- {
182
- "value": "```redis\nHRANDFIELD key [count [WITHVALUES]]\n```\n**HRANDFIELD** returns random field(s) from a hash (Redis 6.2+). Negative count allows duplicates.\n\n```redis\nHRANDFIELD user:1 2 WITHVALUES\n```\nTime complexity: **O(N)** where N is count"
183
- }
184
- ]
185
- },
186
- "HSCAN": {
187
- "contents": [
188
- {
189
- "value": "```redis\nHSCAN key cursor [MATCH pattern] [COUNT count]\n```\n**HSCAN** incrementally iterates hash fields. Use instead of `HGETALL` for large hashes.\n\n```redis\nHSCAN user:1 0 MATCH name* COUNT 10\n```\nTime complexity: **O(1)** per call, **O(N)** for full iteration"
190
- }
191
- ]
192
- },
193
- "LPUSH": {
194
- "contents": [
195
- {
196
- "value": "```redis\nLPUSH key element [element ...]\n```\n**LPUSH** inserts elements at the head (left) of a list. Creates the list if it doesn't exist. Elements are inserted left to right, so the last specified is the first in the list.\n\n```redis\nLPUSH mylist \"world\" \"hello\"\nLRANGE mylist 0 -1 # => \"hello\" \"world\"\n```\nTime complexity: **O(N)** where N is number of elements"
197
- }
198
- ]
199
- },
200
- "RPUSH": {
201
- "contents": [
202
- {
203
- "value": "```redis\nRPUSH key element [element ...]\n```\n**RPUSH** inserts elements at the tail (right) of a list.\n\n```redis\nRPUSH mylist \"hello\" \"world\"\nLRANGE mylist 0 -1 # => \"hello\" \"world\"\n```\nTime complexity: **O(N)**"
204
- }
205
- ]
206
- },
207
- "LPOP": {
208
- "contents": [
209
- {
210
- "value": "```redis\nLPOP key [count]\n```\n**LPOP** removes and returns the first element(s) from a list. With `count`, returns up to that many elements (Redis 6.2+).\n\n```redis\nLPOP mylist # => \"hello\"\nLPOP mylist 3 # => multiple elements\n```\nTime complexity: **O(N)** where N is count"
211
- }
212
- ]
213
- },
214
- "RPOP": {
215
- "contents": [
216
- {
217
- "value": "```redis\nRPOP key [count]\n```\n**RPOP** removes and returns the last element(s) from a list.\n\n```redis\nRPOP mylist # => \"world\"\n```\nTime complexity: **O(N)**"
218
- }
219
- ]
220
- },
221
- "LRANGE": {
222
- "contents": [
223
- {
224
- "value": "```redis\nLRANGE key start stop\n```\n**LRANGE** returns elements from a list in the specified range. 0 is the first, -1 is the last.\n\n```redis\nLRANGE mylist 0 -1 # All elements\nLRANGE mylist 0 9 # First 10\n```\nTime complexity: **O(S+N)** where S is start offset and N is range length"
225
- }
226
- ]
227
- },
228
- "LLEN": {
229
- "contents": [
230
- {
231
- "value": "```redis\nLLEN key\n```\n**LLEN** returns the length of a list. Returns 0 if key doesn't exist.\n\n```redis\nLLEN mylist # => 5\n```\nTime complexity: **O(1)**"
232
- }
233
- ]
234
- },
235
- "LINDEX": {
236
- "contents": [
237
- {
238
- "value": "```redis\nLINDEX key index\n```\n**LINDEX** returns the element at `index` in a list. Negative indices count from the tail.\n\n```redis\nLINDEX mylist 0 # First element\nLINDEX mylist -1 # Last element\n```\nTime complexity: **O(N)** where N is the number of elements to traverse"
239
- }
240
- ]
241
- },
242
- "LINSERT": {
243
- "contents": [
244
- {
245
- "value": "```redis\nLINSERT key BEFORE|AFTER pivot element\n```\n**LINSERT** inserts an element before or after the pivot value.\n\n```redis\nLINSERT mylist BEFORE \"World\" \"There\"\n```\nTime complexity: **O(N)** where N is number of elements to traverse"
246
- }
247
- ]
248
- },
249
- "BLPOP": {
250
- "contents": [
251
- {
252
- "value": "```redis\nBLPOP key [key ...] timeout\n```\n**BLPOP** is the blocking version of LPOP. Blocks until an element is available or timeout is reached. Timeout of 0 blocks indefinitely.\n\n```redis\nBLPOP queue:tasks 30\nBLPOP q1 q2 q3 0 # Check multiple queues\n```\nUsed in **message queue** patterns.\nTime complexity: **O(N)** where N is number of keys"
253
- }
254
- ]
255
- },
256
- "BRPOP": {
257
- "contents": [
258
- {
259
- "value": "```redis\nBRPOP key [key ...] timeout\n```\n**BRPOP** is the blocking version of RPOP. Blocks until an element is available.\n\n```redis\nBRPOP queue:tasks 30\n```\nTime complexity: **O(N)**"
260
- }
261
- ]
262
- },
263
- "LMOVE": {
264
- "contents": [
265
- {
266
- "value": "```redis\nLMOVE source destination LEFT|RIGHT LEFT|RIGHT\n```\n**LMOVE** atomically pops from one end of source and pushes to one end of destination (Redis 6.2+). Replaces RPOPLPUSH.\n\n```redis\nLMOVE src dst LEFT RIGHT # Move head of src to tail of dst\n```\nTime complexity: **O(1)**"
267
- }
268
- ]
269
- },
270
- "LPOS": {
271
- "contents": [
272
- {
273
- "value": "```redis\nLPOS key element [RANK rank] [COUNT count] [MAXLEN maxlen]\n```\n**LPOS** returns the position of an element in a list (Redis 6.0.6+).\n\n```redis\nLPOS mylist \"hello\" # => 0\nLPOS mylist \"hello\" RANK 2 # Second occurrence\nLPOS mylist \"hello\" COUNT 0 # All positions\n```\nTime complexity: **O(N)**"
274
- }
275
- ]
276
- },
277
- "SADD": {
278
- "contents": [
279
- {
280
- "value": "```redis\nSADD key member [member ...]\n```\n**SADD** adds members to a set. Ignores members that already exist. Returns the number of new members added.\n\n```redis\nSADD tags \"redis\" \"database\" \"nosql\"\nSMEMBERS tags # => \"redis\" \"database\" \"nosql\"\n```\nTime complexity: **O(N)** where N is number of members"
281
- }
282
- ]
283
- },
284
- "SREM": {
285
- "contents": [
286
- {
287
- "value": "```redis\nSREM key member [member ...]\n```\n**SREM** removes members from a set. Returns the number of members removed.\n\n```redis\nSREM tags \"nosql\"\n```\nTime complexity: **O(N)**"
288
- }
289
- ]
290
- },
291
- "SMEMBERS": {
292
- "contents": [
293
- {
294
- "value": "```redis\nSMEMBERS key\n```\n**SMEMBERS** returns all members of a set. For large sets, use `SSCAN`.\n\n```redis\nSMEMBERS tags # => \"redis\" \"database\"\n```\nTime complexity: **O(N)**"
295
- }
296
- ]
297
- },
298
- "SISMEMBER": {
299
- "contents": [
300
- {
301
- "value": "```redis\nSISMEMBER key member\n```\n**SISMEMBER** checks if `member` is in the set. Returns 1 or 0.\n\n```redis\nSISMEMBER tags \"redis\" # => 1\n```\nTime complexity: **O(1)**"
302
- }
303
- ]
304
- },
305
- "SCARD": {
306
- "contents": [
307
- {
308
- "value": "```redis\nSCARD key\n```\n**SCARD** returns the number of elements in a set (cardinality).\n\n```redis\nSCARD tags # => 3\n```\nTime complexity: **O(1)**"
309
- }
310
- ]
311
- },
312
- "SUNION": {
313
- "contents": [
314
- {
315
- "value": "```redis\nSUNION key [key ...]\n```\n**SUNION** returns the union of multiple sets.\n\n```redis\nSUNION set1 set2 # Members in either set\n```\nTime complexity: **O(N)** where N is total elements across all sets"
316
- }
317
- ]
318
- },
319
- "SINTER": {
320
- "contents": [
321
- {
322
- "value": "```redis\nSINTER key [key ...]\n```\n**SINTER** returns the intersection of multiple sets.\n\n```redis\nSINTER set1 set2 # Members in both sets\n```\nTime complexity: **O(N*M)** worst case"
323
- }
324
- ]
325
- },
326
- "SDIFF": {
327
- "contents": [
328
- {
329
- "value": "```redis\nSDIFF key [key ...]\n```\n**SDIFF** returns members in the first set but not in subsequent sets.\n\n```redis\nSDIFF set1 set2 # Members only in set1\n```\nTime complexity: **O(N)**"
330
- }
331
- ]
332
- },
333
- "SPOP": {
334
- "contents": [
335
- {
336
- "value": "```redis\nSPOP key [count]\n```\n**SPOP** removes and returns random member(s) from a set.\n\n```redis\nSPOP myset # Random member\nSPOP myset 3 # 3 random members\n```\nTime complexity: **O(N)** where N is count"
337
- }
338
- ]
339
- },
340
- "SMOVE": {
341
- "contents": [
342
- {
343
- "value": "```redis\nSMOVE source destination member\n```\n**SMOVE** atomically moves a member from one set to another.\n\n```redis\nSMOVE active archived \"item1\"\n```\nTime complexity: **O(1)**"
344
- }
345
- ]
346
- },
347
- "SINTERCARD": {
348
- "contents": [
349
- {
350
- "value": "```redis\nSINTERCARD numkeys key [key ...] [LIMIT limit]\n```\n**SINTERCARD** returns the cardinality of the intersection without computing the full result (Redis 7.0+). Use `LIMIT` to stop early.\n\n```redis\nSINTERCARD 2 set1 set2 LIMIT 100\n```\nTime complexity: **O(N*M)** worst case"
351
- }
352
- ]
353
- },
354
- "ZADD": {
355
- "contents": [
356
- {
357
- "value": "```redis\nZADD key [NX|XX] [GT|LT] [CH] score member [score member ...]\n```\n**ZADD** adds members with scores to a sorted set. Options:\n- `NX` — only add new elements\n- `XX` — only update existing elements\n- `GT` — only update if new score > current\n- `LT` — only update if new score < current\n- `CH` — return number of changed elements\n\n```redis\nZADD leaderboard 100 \"alice\" 200 \"bob\"\nZADD leaderboard GT CH 250 \"alice\" # Update if higher\n```\nTime complexity: **O(log(N))** per element"
358
- }
359
- ]
360
- },
361
- "ZRANGE": {
362
- "contents": [
363
- {
364
- "value": "```redis\nZRANGE key min max [BYSCORE|BYLEX] [REV] [LIMIT offset count] [WITHSCORES]\n```\n**ZRANGE** returns members in a sorted set. Since Redis 6.2, replaces ZRANGEBYSCORE, ZRANGEBYLEX, ZREVRANGE.\n\n```redis\nZRANGE lb 0 9 WITHSCORES # Top 10 by rank\nZRANGE lb 100 200 BYSCORE LIMIT 0 10 # By score range\nZRANGE lb 0 9 REV WITHSCORES # Reverse order\n```\nTime complexity: **O(log(N)+M)** where M is the result set size"
365
- }
366
- ]
367
- },
368
- "ZSCORE": {
369
- "contents": [
370
- {
371
- "value": "```redis\nZSCORE key member\n```\n**ZSCORE** returns the score of a member. Returns `nil` if member or key doesn't exist.\n\n```redis\nZSCORE leaderboard \"alice\" # => \"100\"\n```\nTime complexity: **O(1)**"
372
- }
373
- ]
374
- },
375
- "ZRANK": {
376
- "contents": [
377
- {
378
- "value": "```redis\nZRANK key member [WITHSCORE]\n```\n**ZRANK** returns the rank (0-based, ascending by score) of a member. Returns `nil` if not found.\n\n```redis\nZRANK leaderboard \"alice\" # => 0 (lowest score)\nZRANK leaderboard \"alice\" WITHSCORE # (Redis 7.2+)\n```\nTime complexity: **O(log(N))**"
379
- }
380
- ]
381
- },
382
- "ZINCRBY": {
383
- "contents": [
384
- {
385
- "value": "```redis\nZINCRBY key increment member\n```\n**ZINCRBY** increments the score of a member. Creates the member with score if it doesn't exist.\n\n```redis\nZINCRBY leaderboard 10 \"alice\" # => new score\n```\nTime complexity: **O(log(N))**"
386
- }
387
- ]
388
- },
389
- "ZCARD": {
390
- "contents": [
391
- {
392
- "value": "```redis\nZCARD key\n```\n**ZCARD** returns the number of members in a sorted set.\n\n```redis\nZCARD leaderboard # => 5\n```\nTime complexity: **O(1)**"
393
- }
394
- ]
395
- },
396
- "ZCOUNT": {
397
- "contents": [
398
- {
399
- "value": "```redis\nZCOUNT key min max\n```\n**ZCOUNT** counts members with scores in the given range. Use `-inf` and `+inf` for unbounded.\n\n```redis\nZCOUNT leaderboard 100 200\nZCOUNT leaderboard -inf +inf # All\nZCOUNT leaderboard \"(100\" 200 # Exclusive min\n```\nTime complexity: **O(log(N))**"
400
- }
401
- ]
402
- },
403
- "ZPOPMIN": {
404
- "contents": [
405
- {
406
- "value": "```redis\nZPOPMIN key [count]\n```\n**ZPOPMIN** removes and returns member(s) with the lowest scores.\n\n```redis\nZPOPMIN leaderboard 3\n```\nUseful for **priority queues**.\nTime complexity: **O(log(N)*M)** where M is count"
407
- }
408
- ]
409
- },
410
- "ZPOPMAX": {
411
- "contents": [
412
- {
413
- "value": "```redis\nZPOPMAX key [count]\n```\n**ZPOPMAX** removes and returns member(s) with the highest scores.\n\n```redis\nZPOPMAX leaderboard 3\n```\nTime complexity: **O(log(N)*M)**"
414
- }
415
- ]
416
- },
417
- "ZUNIONSTORE": {
418
- "contents": [
419
- {
420
- "value": "```redis\nZUNIONSTORE dest numkeys key [key ...] [WEIGHTS w1 w2 ...] [AGGREGATE SUM|MIN|MAX]\n```\n**ZUNIONSTORE** stores the union of sorted sets with optional score weighting.\n\n```redis\nZUNIONSTORE combined 2 zset1 zset2 WEIGHTS 2 1 AGGREGATE MAX\n```\nTime complexity: **O(N*log(N))** with N being the sum of sizes"
421
- }
422
- ]
423
- },
424
- "ZINTERSTORE": {
425
- "contents": [
426
- {
427
- "value": "```redis\nZINTERSTORE dest numkeys key [key ...] [WEIGHTS w1 w2 ...] [AGGREGATE SUM|MIN|MAX]\n```\n**ZINTERSTORE** stores the intersection of sorted sets.\n\n```redis\nZINTERSTORE common 2 zset1 zset2\n```\nTime complexity: **O(N*K*log(N))** where K is number of keys"
428
- }
429
- ]
430
- },
431
- "DEL": {
432
- "contents": [
433
- {
434
- "value": "```redis\nDEL key [key ...]\n```\n**DEL** removes keys synchronously. Returns the number of keys removed.\n\n```redis\nDEL key1 key2 key3 # => 3\n```\n**Note**: For non-blocking deletion of large keys, use `UNLINK`.\nTime complexity: **O(N)** where N is number of keys"
435
- }
436
- ]
437
- },
438
- "UNLINK": {
439
- "contents": [
440
- {
441
- "value": "```redis\nUNLINK key [key ...]\n```\n**UNLINK** removes keys asynchronously (non-blocking). The actual memory reclamation happens in a background thread.\n\n```redis\nUNLINK bigkey1 bigkey2\n```\n**Preferred over DEL** for large values (big lists, sets, hashes).\nTime complexity: **O(1)** for each key, **O(N)** for reclamation in background"
442
- }
443
- ]
444
- },
445
- "EXISTS": {
446
- "contents": [
447
- {
448
- "value": "```redis\nEXISTS key [key ...]\n```\n**EXISTS** checks if key(s) exist. Returns the count of existing keys.\n\n```redis\nEXISTS key1 # => 1\nEXISTS key1 key2 key3 # => 2 (two exist)\n```\nTime complexity: **O(N)** where N is number of keys"
449
- }
450
- ]
451
- },
452
- "TYPE": {
453
- "contents": [
454
- {
455
- "value": "```redis\nTYPE key\n```\n**TYPE** returns the data type of the value at `key`: string, list, set, zset, hash, stream.\n\n```redis\nSET mykey \"hello\"\nTYPE mykey # => string\nLPUSH mylist \"a\"\nTYPE mylist # => list\n```\nTime complexity: **O(1)**"
456
- }
457
- ]
458
- },
459
- "EXPIRE": {
460
- "contents": [
461
- {
462
- "value": "```redis\nEXPIRE key seconds [NX|XX|GT|LT]\n```\n**EXPIRE** sets a timeout on a key in seconds. Options (Redis 7.0+):\n- `NX` — set expiry only if key has no expiry\n- `XX` — set expiry only if key has an existing expiry\n- `GT` — set only if new expiry > current\n- `LT` — set only if new expiry < current\n\n```redis\nSET mykey \"hello\"\nEXPIRE mykey 300\nTTL mykey # => 300\n```\nTime complexity: **O(1)**"
463
- }
464
- ]
465
- },
466
- "TTL": {
467
- "contents": [
468
- {
469
- "value": "```redis\nTTL key\n```\n**TTL** returns remaining time to live in seconds. Returns -2 if key doesn't exist, -1 if key has no expiry.\n\n```redis\nSET mykey \"hello\" EX 60\nTTL mykey # => 60\nTTL nonexistent # => -2\nTTL persistent_key # => -1\n```\nTime complexity: **O(1)**"
470
- }
471
- ]
472
- },
473
- "PTTL": {
474
- "contents": [
475
- {
476
- "value": "```redis\nPTTL key\n```\n**PTTL** returns remaining TTL in **milliseconds**. Returns -2 if key doesn't exist, -1 if no expiry.\n\n```redis\nPTTL mykey # => 59500\n```\nTime complexity: **O(1)**"
477
- }
478
- ]
479
- },
480
- "PERSIST": {
481
- "contents": [
482
- {
483
- "value": "```redis\nPERSIST key\n```\n**PERSIST** removes the expiration from a key, making it persistent.\n\n```redis\nSET mykey \"hello\" EX 60\nPERSIST mykey\nTTL mykey # => -1\n```\nTime complexity: **O(1)**"
484
- }
485
- ]
486
- },
487
- "KEYS": {
488
- "contents": [
489
- {
490
- "value": "```redis\nKEYS pattern\n```\n**KEYS** finds all keys matching a glob pattern.\n\n⚠️ **Warning**: `KEYS *` blocks the server on large databases. Use `SCAN` in production.\n\n```redis\nKEYS * # All keys\nKEYS user:* # Keys starting with user:\nKEYS h?llo # hello, hallo, hxllo...\n```\nTime complexity: **O(N)**"
491
- }
492
- ]
493
- },
494
- "SCAN": {
495
- "contents": [
496
- {
497
- "value": "```redis\nSCAN cursor [MATCH pattern] [COUNT hint] [TYPE type]\n```\n**SCAN** incrementally iterates the key space. Non-blocking alternative to `KEYS`. Returns a cursor and a batch of keys.\n\n```redis\nSCAN 0 MATCH user:* COUNT 100\nSCAN 0 TYPE string # Only string keys\n```\nIterate until cursor returns 0.\nTime complexity: **O(1)** per call, **O(N)** for full iteration"
498
- }
499
- ]
500
- },
501
- "RENAME": {
502
- "contents": [
503
- {
504
- "value": "```redis\nRENAME key newkey\n```\n**RENAME** renames a key. Overwrites `newkey` if it already exists.\n\n```redis\nRENAME old_name new_name\n```\nTime complexity: **O(1)**"
505
- }
506
- ]
507
- },
508
- "DUMP": {
509
- "contents": [
510
- {
511
- "value": "```redis\nDUMP key\n```\n**DUMP** serializes the value at `key` in a Redis-specific format. Use with `RESTORE` for key migration.\n\n```redis\nDUMP mykey\n# Returns binary encoded value\n```\nTime complexity: **O(1)** to access, **O(N*M)** to serialize where M is serialized size"
512
- }
513
- ]
514
- },
515
- "RESTORE": {
516
- "contents": [
517
- {
518
- "value": "```redis\nRESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]\n```\n**RESTORE** deserializes a value from `DUMP`. Use `REPLACE` to overwrite existing key.\n\n```redis\nDUMP mykey # on source\nRESTORE mykey 0 \"\\x00...\" REPLACE # on destination\n```\nTime complexity: **O(1)** to access, **O(N*M)** to reconstruct"
519
- }
520
- ]
521
- },
522
- "COPY": {
523
- "contents": [
524
- {
525
- "value": "```redis\nCOPY source destination [DB db] [REPLACE]\n```\n**COPY** copies a key's value to another key (Redis 6.2+). Use `REPLACE` to overwrite destination.\n\n```redis\nCOPY src dst REPLACE\nCOPY src dst DB 1 # Copy to different database\n```\nTime complexity: **O(N)** where N is the size of the value"
526
- }
527
- ]
528
- },
529
- "SORT": {
530
- "contents": [
531
- {
532
- "value": "```redis\nSORT key [BY pattern] [LIMIT offset count] [GET pattern ...] [ASC|DESC] [ALPHA] [STORE dest]\n```\n**SORT** sorts elements in a list, set, or sorted set. Can dereference external keys.\n\n```redis\nSORT mylist ALPHA DESC LIMIT 0 10\nSORT mylist BY weight_* GET # GET name_* STORE sorted\n```\nTime complexity: **O(N+M*log(M))** where N is list size, M is number of returned elements"
533
- }
534
- ]
535
- },
536
- "OBJECT ENCODING": {
537
- "contents": [
538
- {
539
- "value": "```redis\nOBJECT ENCODING key\n```\n**OBJECT ENCODING** returns the internal encoding used by Redis for the value.\n\n```redis\nOBJECT ENCODING mykey\n# Returns: embstr, int, raw, ziplist, listpack, quicklist,\n# hashtable, skiplist, intset, etc.\n```\nUseful for understanding memory optimization.\nTime complexity: **O(1)**"
540
- }
541
- ]
542
- },
543
- "RANDOMKEY": {
544
- "contents": [
545
- {
546
- "value": "```redis\nRANDOMKEY\n```\n**RANDOMKEY** returns a random key from the current database. Returns `nil` if the database is empty.\n\n```redis\nRANDOMKEY # => \"user:42\"\n```\nTime complexity: **O(1)**"
547
- }
548
- ]
549
- },
550
- "PFADD": {
551
- "contents": [
552
- {
553
- "value": "```redis\nPFADD key element [element ...]\n```\n**PFADD** adds elements to a HyperLogLog. Uses ~12KB of memory regardless of cardinality.\n\n```redis\nPFADD unique_visitors \"user1\" \"user2\" \"user3\"\nPFCOUNT unique_visitors # Approximate unique count\n```\nIdeal for **counting unique items** (visitors, IPs, etc.) with 0.81% standard error.\nTime complexity: **O(N)**"
554
- }
555
- ]
556
- },
557
- "PFCOUNT": {
558
- "contents": [
559
- {
560
- "value": "```redis\nPFCOUNT key [key ...]\n```\n**PFCOUNT** returns the approximate cardinality of a HyperLogLog. With multiple keys, returns the cardinality of the union.\n\n```redis\nPFCOUNT visitors # => ~1000000\nPFCOUNT day1 day2 day3 # Union of all three\n```\nTime complexity: **O(1)** for single key, **O(N)** for union"
561
- }
562
- ]
563
- },
564
- "PFMERGE": {
565
- "contents": [
566
- {
567
- "value": "```redis\nPFMERGE destkey sourcekey [sourcekey ...]\n```\n**PFMERGE** merges multiple HyperLogLogs into one.\n\n```redis\nPFMERGE weekly_visitors mon tue wed thu fri\nPFCOUNT weekly_visitors\n```\nTime complexity: **O(N)** where N is number of source keys"
568
- }
569
- ]
570
- },
571
- "SETBIT": {
572
- "contents": [
573
- {
574
- "value": "```redis\nSETBIT key offset value\n```\n**SETBIT** sets or clears the bit at `offset`. Returns the original bit value.\n\n```redis\nSETBIT active_users 1000 1 # User 1000 is active\nGETBIT active_users 1000 # => 1\n```\nUseful for **flags, presence tracking, feature flags**.\nTime complexity: **O(1)**"
575
- }
576
- ]
577
- },
578
- "GETBIT": {
579
- "contents": [
580
- {
581
- "value": "```redis\nGETBIT key offset\n```\n**GETBIT** returns the bit value at `offset`.\n\n```redis\nGETBIT active_users 1000 # => 1 (active)\nGETBIT active_users 9999 # => 0 (not set)\n```\nTime complexity: **O(1)**"
582
- }
583
- ]
584
- },
585
- "BITCOUNT": {
586
- "contents": [
587
- {
588
- "value": "```redis\nBITCOUNT key [start end [BYTE|BIT]]\n```\n**BITCOUNT** counts the number of set bits (1s). Optional range specifies byte or bit range.\n\n```redis\nBITCOUNT active_users # Total active users\nBITCOUNT active_users 0 0 # First byte\n```\nTime complexity: **O(N)**"
589
- }
590
- ]
591
- },
592
- "BITOP": {
593
- "contents": [
594
- {
595
- "value": "```redis\nBITOP operation destkey key [key ...]\n```\n**BITOP** performs bitwise operations (AND, OR, XOR, NOT) between strings.\n\n```redis\nBITOP AND both_active day1_active day2_active\nBITOP OR any_active day1_active day2_active\n```\nUseful for **combining bitmap flags**.\nTime complexity: **O(N)**"
596
- }
597
- ]
598
- },
599
- "XADD": {
600
- "contents": [
601
- {
602
- "value": "```redis\nXADD key [NOMKSTREAM] [MAXLEN|MINID [=|~] threshold] *|id field value [field value ...]\n```\n**XADD** appends an entry to a stream. Use `*` for auto-generated ID.\n\n```redis\nXADD mystream * sensor_id 1234 temperature 19.8\nXADD mystream MAXLEN ~ 1000 * data value # Cap at ~1000 entries\n```\nStreams are the Redis data structure for **log/event processing**.\nTime complexity: **O(1)** when ID is auto-generated"
603
- }
604
- ]
605
- },
606
- "XREAD": {
607
- "contents": [
608
- {
609
- "value": "```redis\nXREAD [COUNT count] [BLOCK ms] STREAMS key [key ...] id [id ...]\n```\n**XREAD** reads entries from one or more streams. Use `$` to read only new entries.\n\n```redis\nXREAD COUNT 10 STREAMS mystream 0 # From beginning\nXREAD BLOCK 5000 COUNT 10 STREAMS mystream $ # Block for new entries\n```\nTime complexity: **O(N)** where N is count"
610
- }
611
- ]
612
- },
613
- "XREADGROUP": {
614
- "contents": [
615
- {
616
- "value": "```redis\nXREADGROUP GROUP group consumer [COUNT count] [BLOCK ms] [NOACK] STREAMS key [key ...] id [id ...]\n```\n**XREADGROUP** reads from a stream as a consumer group member. Use `>` to read only undelivered messages.\n\n```redis\nXREADGROUP GROUP mygroup consumer1 COUNT 10 BLOCK 5000 STREAMS mystream >\n```\nConsumer groups enable **reliable message processing** with acknowledgments.\nTime complexity: **O(M)** where M is count"
617
- }
618
- ]
619
- },
620
- "XACK": {
621
- "contents": [
622
- {
623
- "value": "```redis\nXACK key group id [id ...]\n```\n**XACK** acknowledges messages, removing them from the consumer's pending entries list (PEL).\n\n```redis\nXACK mystream mygroup 1526569495631-0\n```\nTime complexity: **O(1)** per ID"
624
- }
625
- ]
626
- },
627
- "XGROUP CREATE": {
628
- "contents": [
629
- {
630
- "value": "```redis\nXGROUP CREATE key group id|$ [MKSTREAM] [ENTRIESREAD entries-read]\n```\n**XGROUP CREATE** creates a consumer group.\n- Use `$` to consume only new messages\n- Use `0` to consume from the beginning\n- `MKSTREAM` creates the stream if it doesn't exist\n\n```redis\nXGROUP CREATE events processors $ MKSTREAM\nXGROUP CREATE events reprocessors 0\n```\nTime complexity: **O(1)**"
631
- }
632
- ]
633
- },
634
- "XPENDING": {
635
- "contents": [
636
- {
637
- "value": "```redis\nXPENDING key group [[IDLE min-idle-time] start end count [consumer]]\n```\n**XPENDING** inspects the pending entries list — messages delivered but not yet acknowledged.\n\n```redis\nXPENDING mystream mygroup # Summary\nXPENDING mystream mygroup - + 10 # First 10 pending\nXPENDING mystream mygroup IDLE 60000 - + 10 # Idle > 60s\n```\nTime complexity: **O(N)**"
638
- }
639
- ]
640
- },
641
- "XCLAIM": {
642
- "contents": [
643
- {
644
- "value": "```redis\nXCLAIM key group consumer min-idle-time id [id ...] [IDLE ms] [TIME ms] [RETRYCOUNT count] [FORCE] [JUSTID]\n```\n**XCLAIM** transfers ownership of pending messages to another consumer. Used for **message recovery** when a consumer crashes.\n\n```redis\nXCLAIM mystream mygroup consumer2 3600000 1526569495631-0\n```\nTime complexity: **O(log(N))** per message"
645
- }
646
- ]
647
- },
648
- "XAUTOCLAIM": {
649
- "contents": [
650
- {
651
- "value": "```redis\nXAUTOCLAIM key group consumer min-idle-time start [COUNT count] [JUSTID]\n```\n**XAUTOCLAIM** automatically transfers idle pending messages (Redis 6.2+). Simpler than XPENDING + XCLAIM.\n\n```redis\nXAUTOCLAIM mystream mygroup consumer2 3600000 0-0 COUNT 25\n```\nTime complexity: **O(1)** per claimed message"
652
- }
653
- ]
654
- },
655
- "XINFO STREAM": {
656
- "contents": [
657
- {
658
- "value": "```redis\nXINFO STREAM key [FULL [COUNT count]]\n```\n**XINFO STREAM** returns information about a stream including length, first/last entry, consumer groups.\n\n```redis\nXINFO STREAM mystream\nXINFO STREAM mystream FULL # Detailed view\n```\nTime complexity: **O(1)** for default, **O(N)** for FULL"
659
- }
660
- ]
661
- },
662
- "XLEN": {
663
- "contents": [
664
- {
665
- "value": "```redis\nXLEN key\n```\n**XLEN** returns the number of entries in a stream.\n\n```redis\nXLEN mystream # => 150\n```\nTime complexity: **O(1)**"
666
- }
667
- ]
668
- },
669
- "XTRIM": {
670
- "contents": [
671
- {
672
- "value": "```redis\nXTRIM key MAXLEN|MINID [=|~] threshold\n```\n**XTRIM** trims a stream to a maximum length or minimum ID. Use `~` for approximate trimming (faster).\n\n```redis\nXTRIM mystream MAXLEN ~ 1000\nXTRIM mystream MINID 1526569495631-0\n```\nTime complexity: **O(N)** where N is the number of evicted entries"
673
- }
674
- ]
675
- },
676
- "SUBSCRIBE": {
677
- "contents": [
678
- {
679
- "value": "```redis\nSUBSCRIBE channel [channel ...]\n```\n**SUBSCRIBE** listens for messages on one or more channels. The connection enters subscriber mode — only (P|S)SUBSCRIBE, (P|S)UNSUBSCRIBE, PING, RESET, QUIT are allowed.\n\n```redis\nSUBSCRIBE notifications alerts\n```\nMessages are fire-and-forget — no persistence, no replay.\nTime complexity: **O(N)** where N is number of channels"
680
- }
681
- ]
682
- },
683
- "PUBLISH": {
684
- "contents": [
685
- {
686
- "value": "```redis\nPUBLISH channel message\n```\n**PUBLISH** sends a message to all subscribers of a channel. Returns the number of clients that received it.\n\n```redis\nPUBLISH notifications \"New order received\"\n```\nTime complexity: **O(N+M)** where N is channel subscribers and M is pattern subscribers"
687
- }
688
- ]
689
- },
690
- "PSUBSCRIBE": {
691
- "contents": [
692
- {
693
- "value": "```redis\nPSUBSCRIBE pattern [pattern ...]\n```\n**PSUBSCRIBE** subscribes to channels matching glob patterns.\n\n```redis\nPSUBSCRIBE news.* # news.sports, news.tech, etc.\nPSUBSCRIBE __keyevent@0__:* # Keyspace notifications\n```\nTime complexity: **O(N)** where N is number of patterns"
694
- }
695
- ]
696
- },
697
- "MULTI": {
698
- "contents": [
699
- {
700
- "value": "```redis\nMULTI\n```\n**MULTI** marks the start of a transaction block. Subsequent commands are queued and executed atomically with `EXEC`.\n\n```redis\nMULTI\nSET key1 \"val1\"\nSET key2 \"val2\"\nINCR counter\nEXEC # => [OK, OK, 1]\n```\nTransactions are **atomic** — either all commands execute or none.\nTime complexity: **O(1)**"
701
- }
702
- ]
703
- },
704
- "EXEC": {
705
- "contents": [
706
- {
707
- "value": "```redis\nEXEC\n```\n**EXEC** executes all queued commands in the transaction and restores the connection to normal. Returns an array of results.\n\nReturns `nil` if `WATCH` detected a modification (optimistic lock failure).\n\n```redis\nWATCH balance\nMULTI\nDECRBY balance 100\nINCRBY other_balance 100\nEXEC # nil if balance was modified\n```\nTime complexity: **O(N)** where N is number of queued commands"
708
- }
709
- ]
710
- },
711
- "WATCH": {
712
- "contents": [
713
- {
714
- "value": "```redis\nWATCH key [key ...]\n```\n**WATCH** enables optimistic locking (check-and-set). If any watched key is modified before `EXEC`, the transaction is aborted.\n\n```redis\nWATCH balance\nval = GET balance\nMULTI\nSET balance (val - 100)\nEXEC # nil if another client changed balance\n```\nTime complexity: **O(1)** per key"
715
- }
716
- ]
717
- },
718
- "DISCARD": {
719
- "contents": [
720
- {
721
- "value": "```redis\nDISCARD\n```\n**DISCARD** aborts the transaction, discarding all queued commands.\n\n```redis\nMULTI\nSET key1 \"val1\"\nDISCARD # Transaction cancelled\n```\nTime complexity: **O(N)** where N is number of queued commands"
722
- }
723
- ]
724
- },
725
- "EVAL": {
726
- "contents": [
727
- {
728
- "value": "```redis\nEVAL script numkeys [key ...] [arg ...]\n```\n**EVAL** executes a Lua script server-side. Scripts are **atomic** — no other command runs during execution.\n\n```redis\nEVAL \"return redis.call('GET',KEYS[1])\" 1 mykey\nEVAL \"redis.call('SET',KEYS[1],ARGV[1]); return redis.call('GET',KEYS[1])\" 1 mykey myval\n```\nUse `redis.call()` for errors, `redis.pcall()` for protected calls.\nTime complexity: Depends on the script"
729
- }
730
- ]
731
- },
732
- "EVALSHA": {
733
- "contents": [
734
- {
735
- "value": "```redis\nEVALSHA sha1 numkeys [key ...] [arg ...]\n```\n**EVALSHA** executes a cached Lua script by its SHA1 hash. Load scripts with `SCRIPT LOAD` first.\n\n```redis\nSCRIPT LOAD \"return redis.call('GET',KEYS[1])\" # => sha1\nEVALSHA sha1 1 mykey\n```\nMore efficient than EVAL for repeated scripts.\nTime complexity: Depends on the script"
736
- }
737
- ]
738
- },
739
- "FUNCTION LOAD": {
740
- "contents": [
741
- {
742
- "value": "```redis\nFUNCTION LOAD [REPLACE] function-code\n```\n**FUNCTION LOAD** loads a function library (Redis 7.0+). Functions persist across restarts unlike EVAL scripts.\n\n```redis\nFUNCTION LOAD \"#!lua name=mylib\\nredis.register_function('myfunc', function(keys, args) return redis.call('GET', keys[1]) end)\"\nFCALL myfunc 1 mykey\n```\nTime complexity: **O(N)** where N is the function code length"
743
- }
744
- ]
745
- },
746
- "FCALL": {
747
- "contents": [
748
- {
749
- "value": "```redis\nFCALL function numkeys [key ...] [arg ...]\n```\n**FCALL** calls a loaded Redis function (Redis 7.0+).\n\n```redis\nFCALL myfunc 1 mykey\n```\nTime complexity: Depends on the function"
750
- }
751
- ]
752
- },
753
- "GEOADD": {
754
- "contents": [
755
- {
756
- "value": "```redis\nGEOADD key [NX|XX] [CH] longitude latitude member [longitude latitude member ...]\n```\n**GEOADD** adds geospatial items (longitude/latitude) to a sorted set.\n\n```redis\nGEOADD restaurants 13.361389 38.115556 \"Sicily Pizza\"\nGEOADD restaurants NX 2.349014 48.864716 \"Paris Cafe\"\n```\nInternally uses a sorted set with geohash scores.\nTime complexity: **O(log(N))** per item"
757
- }
758
- ]
759
- },
760
- "GEOSEARCH": {
761
- "contents": [
762
- {
763
- "value": "```redis\nGEOSEARCH key FROMMEMBER member|FROMLONLAT lon lat BYRADIUS radius m|km|ft|mi|BYBOX width height m|km|ft|mi [ASC|DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH]\n```\n**GEOSEARCH** finds members within a radius or bounding box (Redis 6.2+).\n\n```redis\nGEOSEARCH places FROMLONLAT 13.361 38.115 BYRADIUS 100 km ASC COUNT 5 WITHDIST\nGEOSEARCH places FROMMEMBER \"home\" BYBOX 400 400 km ASC\n```\nTime complexity: **O(N+log(N))** where N is the number of nearby members"
764
- }
765
- ]
766
- },
767
- "GEODIST": {
768
- "contents": [
769
- {
770
- "value": "```redis\nGEODIST key member1 member2 [M|KM|FT|MI]\n```\n**GEODIST** returns the distance between two geospatial members.\n\n```redis\nGEODIST places \"Rome\" \"Paris\" km # => \"1105.5914\"\n```\nTime complexity: **O(1)**"
771
- }
772
- ]
773
- },
774
- "INFO": {
775
- "contents": [
776
- {
777
- "value": "```redis\nINFO [section [section ...]]\n```\n**INFO** returns server information and statistics. Sections: server, clients, memory, persistence, stats, replication, cpu, commandstats, latencystats, cluster, keyspace, modules, errorstats.\n\n```redis\nINFO # All sections\nINFO memory # Memory usage details\nINFO server # Server version, uptime, etc.\nINFO keyspace # Per-database key counts\n```\nTime complexity: **O(1)**"
778
- }
779
- ]
780
- },
781
- "CONFIG GET": {
782
- "contents": [
783
- {
784
- "value": "```redis\nCONFIG GET parameter [parameter ...]\n```\n**CONFIG GET** reads configuration parameters. Supports glob patterns.\n\n```redis\nCONFIG GET maxmemory\nCONFIG GET *policy*\nCONFIG GET save\n```\nTime complexity: **O(N)** where N is number of parameters"
785
- }
786
- ]
787
- },
788
- "CONFIG SET": {
789
- "contents": [
790
- {
791
- "value": "```redis\nCONFIG SET parameter value [parameter value ...]\n```\n**CONFIG SET** dynamically changes configuration without restart.\n\n```redis\nCONFIG SET maxmemory 256mb\nCONFIG SET maxmemory-policy allkeys-lru\nCONFIG SET save \"3600 1 300 100\"\n```\nTime complexity: **O(N)** for config parameters requiring list processing"
792
- }
793
- ]
794
- },
795
- "FLUSHDB": {
796
- "contents": [
797
- {
798
- "value": "```redis\nFLUSHDB [ASYNC|SYNC]\n```\n**FLUSHDB** deletes all keys in the current database.\n\n⚠️ **Destructive operation** — use with caution in production.\n\n```redis\nFLUSHDB # Synchronous, blocks server\nFLUSHDB ASYNC # Non-blocking\n```\nTime complexity: **O(N)** where N is number of keys"
799
- }
800
- ]
801
- },
802
- "FLUSHALL": {
803
- "contents": [
804
- {
805
- "value": "```redis\nFLUSHALL [ASYNC|SYNC]\n```\n**FLUSHALL** deletes all keys from **all databases**.\n\n⚠️ **Destructive operation** — deletes everything.\n\n```redis\nFLUSHALL ASYNC\n```\nTime complexity: **O(N)** where N is total keys across all databases"
806
- }
807
- ]
808
- },
809
- "BGSAVE": {
810
- "contents": [
811
- {
812
- "value": "```redis\nBGSAVE [SCHEDULE]\n```\n**BGSAVE** triggers a background RDB snapshot. Returns error if another save is in progress (unless `SCHEDULE` is used).\n\n```redis\nBGSAVE\nBGSAVE SCHEDULE # Schedule if another save is running\n```\nTime complexity: **O(1)** to trigger"
813
- }
814
- ]
815
- },
816
- "DBSIZE": {
817
- "contents": [
818
- {
819
- "value": "```redis\nDBSIZE\n```\n**DBSIZE** returns the number of keys in the currently selected database.\n\n```redis\nDBSIZE # => (integer) 42\n```\nTime complexity: **O(1)**"
820
- }
821
- ]
822
- },
823
- "SLOWLOG GET": {
824
- "contents": [
825
- {
826
- "value": "```redis\nSLOWLOG GET [count]\n```\n**SLOWLOG GET** returns entries from the slow log — commands that exceeded the `slowlog-log-slower-than` threshold.\n\n```redis\nSLOWLOG GET 10\n```\nEach entry contains: ID, timestamp, execution time (μs), command + args, client info.\nTime complexity: **O(N)**"
827
- }
828
- ]
829
- },
830
- "CLIENT LIST": {
831
- "contents": [
832
- {
833
- "value": "```redis\nCLIENT LIST [TYPE normal|master|replica|pubsub] [ID id ...]\n```\n**CLIENT LIST** returns info about connected clients: address, fd, age, idle time, flags, database, command.\n\n```redis\nCLIENT LIST\nCLIENT LIST TYPE normal\n```\nTime complexity: **O(N)** where N is number of clients"
834
- }
835
- ]
836
- },
837
- "MEMORY USAGE": {
838
- "contents": [
839
- {
840
- "value": "```redis\nMEMORY USAGE key [SAMPLES count]\n```\n**MEMORY USAGE** estimates memory consumption of a key in bytes, including overhead.\n\n```redis\nMEMORY USAGE mykey # => (integer) 56\nMEMORY USAGE myhash SAMPLES 5 # More accurate for complex types\n```\nTime complexity: **O(1)** for simple keys, **O(N)** with SAMPLES for complex types"
841
- }
842
- ]
843
- },
844
- "MONITOR": {
845
- "contents": [
846
- {
847
- "value": "```redis\nMONITOR\n```\n**MONITOR** streams every command processed by the server in real-time. Useful for debugging.\n\n```redis\nMONITOR\n# Output: 1339518083.107412 [0 127.0.0.1:60866] \"keys\" \"*\"\n```\n⚠️ **Performance impact** — reduces throughput by ~50%. Never use in production."
848
- }
849
- ]
850
- },
851
- "SELECT": {
852
- "contents": [
853
- {
854
- "value": "```redis\nSELECT index\n```\n**SELECT** switches to a different database (0-15 by default).\n\n```redis\nSELECT 1 # Switch to database 1\nSET mykey \"hello\"\nSELECT 0 # Back to database 0\n```\nTime complexity: **O(1)**"
855
- }
856
- ]
857
- },
858
- "ACL SETUSER": {
859
- "contents": [
860
- {
861
- "value": "```redis\nACL SETUSER username [rule [rule ...]]\n```\n**ACL SETUSER** creates or modifies a user's access control rules.\n\nRules:\n- `on`/`off` — enable/disable user\n- `>password` — add password\n- `~pattern` — allowed key patterns\n- `+command` — allow command\n- `-command` — deny command\n- `+@category` — allow command category\n- `allkeys` — allow all keys\n- `allcommands` — allow all commands\n\n```redis\nACL SETUSER readonly on >pass123 ~cached:* +get +mget +hgetall\nACL SETUSER admin on >adminpass allkeys allcommands\n```\nTime complexity: **O(N)** where N is number of rules"
862
- }
863
- ]
864
- },
865
- "AUTH": {
866
- "contents": [
867
- {
868
- "value": "```redis\nAUTH [username] password\n```\n**AUTH** authenticates to the server. With ACL (Redis 6+), provide username and password.\n\n```redis\nAUTH mypassword # Default user\nAUTH myuser mypassword # ACL user\n```\nTime complexity: **O(N)** where N is the number of passwords configured"
869
- }
870
- ]
871
- },
872
- "CLUSTER INFO": {
873
- "contents": [
874
- {
875
- "value": "```redis\nCLUSTER INFO\n```\n**CLUSTER INFO** returns cluster state: enabled, state (ok/fail), known nodes, size, slots assigned, messages sent/received.\n\n```redis\nCLUSTER INFO\n# cluster_enabled:1\n# cluster_state:ok\n# cluster_slots_assigned:16384\n# cluster_size:3\n```\nTime complexity: **O(1)**"
876
- }
877
- ]
878
- },
879
- "CLUSTER NODES": {
880
- "contents": [
881
- {
882
- "value": "```redis\nCLUSTER NODES\n```\n**CLUSTER NODES** returns the cluster membership table. Each line describes a node: ID, address, flags, master, ping/pong times, epoch, link-state, slots.\n\n```redis\nCLUSTER NODES\n# 07c37df... 127.0.0.1:6379 myself,master - 0 0 1 connected 0-5460\n```\nTime complexity: **O(N)** where N is the number of nodes"
883
- }
884
- ]
885
- },
886
- "CLUSTER FAILOVER": {
887
- "contents": [
888
- {
889
- "value": "```redis\nCLUSTER FAILOVER [FORCE|TAKEOVER]\n```\n**CLUSTER FAILOVER** initiates manual failover of a master. Run on the replica.\n\n- No option: safe failover with coordination\n- `FORCE`: force failover even if master is unreachable\n- `TAKEOVER`: force without cluster consensus\n\n```redis\nCLUSTER FAILOVER # Safe failover\n```\nTime complexity: **O(1)**"
890
- }
891
- ]
892
- },
893
- "REPLICAOF": {
894
- "contents": [
895
- {
896
- "value": "```redis\nREPLICAOF host port\nREPLICAOF NO ONE\n```\n**REPLICAOF** makes the server a replica of another or promotes it to master.\n\n```redis\nREPLICAOF 192.168.1.1 6379 # Become replica\nREPLICAOF NO ONE # Promote to master\n```\nTime complexity: **O(1)**"
897
- }
898
- ]
899
- },
900
- "PING": {
901
- "contents": [
902
- {
903
- "value": "```redis\nPING [message]\n```\n**PING** tests connectivity. Returns `PONG` or echoes the message.\n\n```redis\nPING # => PONG\nPING \"hello\" # => \"hello\"\n```\nCommonly used for health checks and keepalive.\nTime complexity: **O(1)**"
904
- }
905
- ]
906
- },
907
- "ACL CAT": "## ACL CAT\n\n```redis\nACL CAT [category]\n```\n\nList all ACL categories or commands in a category.\n\n```redis\n> ACL CAT\n1) \"read\"\n2) \"write\"\n3) \"set\"\n...\n\n> ACL CAT read\n1) \"GET\"\n2) \"MGET\"\n...\n```",
908
- "ACL DELUSER": "## ACL DELUSER\n\n```redis\nACL DELUSER username [username ...]\n```\n\nDelete ACL users. Cannot delete the `default` user.\n\n```redis\n> ACL DELUSER tempuser\nOK\n```",
909
- "ACL GENPASS": "## ACL GENPASS\n\n```redis\nACL GENPASS [bits]\n```\n\nGenerate a secure password for ACL users.\n\n```redis\n> ACL GENPASS\n\"1a2b3c4d5e6f...\"\n\n> ACL GENPASS 128\n\"a1b2c3d4e5f6a7b8...\"\n```",
910
- "ACL GETUSER": "## ACL GETUSER\n\n```redis\nACL GETUSER username\n```\n\nGet ACL rules for a specific user.\n\n```redis\n> ACL GETUSER default\n1) \"flags\"\n2) 1) \"on\"\n3) \"passwords\"\n...\n```",
911
- "CLIENT KILL": "## CLIENT KILL\n\n```redis\nCLIENT KILL [ID id] [ADDR ip:port] [LADDR ip:port] [USER username]\n```\n\nClose client connections matching filters.\n\n```redis\n> CLIENT KILL ID 42\n(integer) 1\n\n> CLIENT KILL ADDR 192.168.1.100:52340\n(integer) 1\n```",
912
- "CLIENT SETNAME": "## CLIENT SETNAME\n\n```redis\nCLIENT SETNAME connection-name\n```\n\nSet a name for the current connection (visible in CLIENT LIST).\n\n```redis\n> CLIENT SETNAME worker-1\nOK\n```",
913
- "CLUSTER ADDSLOTS": "## CLUSTER ADDSLOTS\n\n```redis\nCLUSTER ADDSLOTS slot [slot ...]\n```\n\nAssign hash slots to the current node.\n\n```redis\n> CLUSTER ADDSLOTS 0 1 2 3 4 5\nOK\n```",
914
- "DEBUG OBJECT": "## DEBUG OBJECT\n\n```redis\nDEBUG OBJECT key\n```\n\nGet debugging information about a key's internal encoding.\n\n```redis\n> DEBUG OBJECT mykey\nValue at:0x... refcount:1 encoding:embstr serializedlength:3 lru:... lru_seconds_idle:0\n```",
915
- "BITFIELD": "## BITFIELD\n\n```redis\nBITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]\n```\n\nPerform arbitrary bitfield integer operations on strings.\n\n```redis\n# Set 8-bit unsigned counter at bit offset 0\n> BITFIELD mykey SET u8 0 200\n1) (integer) 0\n\n# Increment by 50 with saturation overflow\n> BITFIELD mykey OVERFLOW SAT INCRBY u8 0 50\n1) (integer) 250\n```",
916
- "BITPOS": "## BITPOS\n\n```redis\nBITPOS key bit [start [end [BYTE|BIT]]]\n```\n\nFind first bit set to 0 or 1.\n\n```redis\n> SET mykey \"\\xff\\xf0\\x00\"\nOK\n> BITPOS mykey 0 -- first 0 bit\n(integer) 12\n> BITPOS mykey 1 -- first 1 bit\n(integer) 0\n```",
917
- "BLMOVE": "## BLMOVE\n\n```redis\nBLMOVE source destination LEFT|RIGHT LEFT|RIGHT timeout\n```\n\nBlocking version of LMOVE. Pop from source list and push to destination.\n\n```redis\n> BLMOVE mylist newlist LEFT RIGHT 0\n\"element\"\n```",
918
- "OBJECT FREQ": "## OBJECT FREQ\n\n```redis\nOBJECT FREQ key\n```\n\nReturn the access frequency for LFU eviction policy.\n\n```redis\n> OBJECT FREQ mykey\n(integer) 5\n```\n\nOnly useful with `maxmemory-policy` set to an LFU variant.",
919
- "OBJECT IDLETIME": "## OBJECT IDLETIME\n\n```redis\nOBJECT IDLETIME key\n```\n\nReturn seconds since the key was last accessed.\n\n```redis\n> OBJECT IDLETIME mykey\n(integer) 120\n```",
920
- "OBJECT REFCOUNT": "## OBJECT REFCOUNT\n\n```redis\nOBJECT REFCOUNT key\n```\n\nReturn the reference count of the object (for debugging).\n\n```redis\n> OBJECT REFCOUNT mykey\n(integer) 1\n```",
921
- "MEMORY DOCTOR": "## MEMORY DOCTOR\n\n```redis\nMEMORY DOCTOR\n```\n\nReturn memory problems report.\n\n```redis\n> MEMORY DOCTOR\n\"Sam, I have no memory problems\"\n```",
922
- "LATENCY LATEST": "## LATENCY LATEST\n\n```redis\nLATENCY LATEST\n```\n\nReturn latest latency samples for all events.\n\n```redis\n> LATENCY LATEST\n1) 1) \"command\"\n 2) (integer) 1695000000\n 3) (integer) 15\n 4) (integer) 20\n```",
923
- "LATENCY HISTORY": "## LATENCY HISTORY\n\n```redis\nLATENCY HISTORY event\n```\n\nReturn latency history for a specific event.\n\n```redis\n> LATENCY HISTORY command\n1) 1) (integer) 1695000000\n 2) (integer) 15\n2) 1) (integer) 1695000001\n 2) (integer) 12\n```",
924
- "FUNCTION CALL": "## FCALL / FCALL_RO\n\n```redis\nFCALL function numkeys [key ...] [arg ...]\nFCALL_RO function numkeys [key ...] [arg ...]\n```\n\nCall a previously loaded Redis Function.\n\n```redis\n> FCALL myfunc 1 mykey\n\"value\"\n```",
925
- "FUNCTION LIST": "## FUNCTION LIST\n\n```redis\nFUNCTION LIST [LIBRARYNAME pattern] [WITHCODE]\n```\n\nList loaded function libraries.\n\n```redis\n> FUNCTION LIST\n1) 1) \"library_name\"\n 2) \"mylib\"\n 3) \"functions\"\n 4) 1) 1) \"name\"\n 2) \"myfunc\"\n```",
926
- "WAITAOF": "## WAITAOF\n\n```redis\nWAITAOF numlocal numreplicas timeout\n```\n\nWait for AOF fsync on local and replicas. Returns number of local fsyncs and replicas that acknowledged.\n\n```redis\n> WAITAOF 1 0 5000 -- wait for local fsync, 5s timeout\n1) (integer) 1\n2) (integer) 0\n```",
927
- "GETSET": "## GETSET\n\n```redis\nGETSET key value\n```\n\nAtomically set key to value and return the old value. Deprecated in favor of SET with GET option.\n\n**Group:** Strings",
928
- "MSETNX": "## MSETNX\n\n```redis\nMSETNX key value [key value ...]\n```\n\nSet multiple keys only if none of them exist. Atomic — all or nothing.\n\n**Group:** Strings",
929
- "PSETEX": "## PSETEX\n\n```redis\nPSETEX key milliseconds value\n```\n\nSet key to value with expiration in milliseconds.\n\n**Group:** Strings",
930
- "SETRANGE": "## SETRANGE\n\n```redis\nSETRANGE key offset value\n```\n\nOverwrite part of the string at key starting at offset.\n\n**Group:** Strings",
931
- "DECRBY": "## DECRBY\n\n```redis\nDECRBY key decrement\n```\n\nAtomically decrement the integer value of key by the given amount.\n\n**Group:** Strings",
932
- "SUBSTR": "## SUBSTR\n\n```redis\nSUBSTR key start end\n```\n\nReturns a substring. Deprecated alias for GETRANGE.\n\n**Group:** Strings",
933
- "HKEYS": "## HKEYS\n\n```redis\nHKEYS key\n```\n\nReturns all field names in a hash.\n\n**Group:** Hashes",
934
- "HVALS": "## HVALS\n\n```redis\nHVALS key\n```\n\nReturns all values in a hash.\n\n**Group:** Hashes",
935
- "HINCRBYFLOAT": "## HINCRBYFLOAT\n\n```redis\nHINCRBYFLOAT key field increment\n```\n\nIncrement the float value of a hash field.\n\n**Group:** Hashes",
936
- "HSETNX": "## HSETNX\n\n```redis\nHSETNX key field value\n```\n\nSet hash field only if it does not exist.\n\n**Group:** Hashes",
937
- "LSET": "## LSET\n\n```redis\nLSET key index element\n```\n\nSet the element at index in a list.\n\n**Group:** Lists",
938
- "LREM": "## LREM\n\n```redis\nLREM key count element\n```\n\nRemove count occurrences of element. count>0: head to tail; count<0: tail to head; 0: all.\n\n**Group:** Lists",
939
- "LTRIM": "## LTRIM\n\n```redis\nLTRIM key start stop\n```\n\nTrim list to the specified range.\n\n**Group:** Lists",
940
- "RPOPLPUSH": "## RPOPLPUSH\n\n```redis\nRPOPLPUSH source destination\n```\n\nPop from tail of source and push to head of destination. Deprecated — use LMOVE.\n\n**Group:** Lists",
941
- "LMPOP": "## LMPOP\n\n```redis\nLMPOP numkeys key [key ...] LEFT|RIGHT [COUNT count]\n```\n\nPop from first non-empty list. Redis 7.0+.\n\n**Group:** Lists",
942
- "BLMPOP": "## BLMPOP\n\n```redis\nBLMPOP timeout numkeys key [key ...] LEFT|RIGHT [COUNT count]\n```\n\nBlocking version of LMPOP. Redis 7.0+.\n\n**Group:** Lists",
943
- "LPUSHX": "## LPUSHX\n\n```redis\nLPUSHX key element [element ...]\n```\n\nPush to head only if list exists.\n\n**Group:** Lists",
944
- "RPUSHX": "## RPUSHX\n\n```redis\nRPUSHX key element [element ...]\n```\n\nPush to tail only if list exists.\n\n**Group:** Lists",
945
- "SMISMEMBER": "## SMISMEMBER\n\n```redis\nSMISMEMBER key member [member ...]\n```\n\nCheck multiple members. Returns array of 1/0. Redis 6.2+.\n\n**Group:** Sets",
946
- "SRANDMEMBER": "## SRANDMEMBER\n\n```redis\nSRANDMEMBER key [count]\n```\n\nGet random member(s) without removing.\n\n**Group:** Sets",
947
- "SUNIONSTORE": "## SUNIONSTORE\n\n```redis\nSUNIONSTORE destination key [key ...]\n```\n\nStore the union of sets.\n\n**Group:** Sets",
948
- "SINTERSTORE": "## SINTERSTORE\n\n```redis\nSINTERSTORE destination key [key ...]\n```\n\nStore the intersection of sets.\n\n**Group:** Sets",
949
- "SDIFFSTORE": "## SDIFFSTORE\n\n```redis\nSDIFFSTORE destination key [key ...]\n```\n\nStore the difference of sets.\n\n**Group:** Sets",
950
- "SSCAN": "## SSCAN\n\n```redis\nSSCAN key cursor [MATCH pattern] [COUNT count]\n```\n\nIncrementally iterate set members.\n\n**Group:** Sets",
951
- "ZREM": "## ZREM\n\n```redis\nZREM key member [member ...]\n```\n\nRemove members from a sorted set.\n\n**Group:** Sorted Sets",
952
- "ZMSCORE": "## ZMSCORE\n\n```redis\nZMSCORE key member [member ...]\n```\n\nGet scores of multiple members. Redis 6.2+.\n\n**Group:** Sorted Sets",
953
- "ZREVRANK": "## ZREVRANK\n\n```redis\nZREVRANK key member [WITHSCORE]\n```\n\nGet the rank of a member (0-based, descending).\n\n**Group:** Sorted Sets",
954
- "ZLEXCOUNT": "## ZLEXCOUNT\n\n```redis\nZLEXCOUNT key min max\n```\n\nCount members in a lex range when all scores are equal.\n\n**Group:** Sorted Sets",
955
- "ZRANGEBYSCORE": "## ZRANGEBYSCORE\n\n```redis\nZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]\n```\n\nReturn members with scores in range. Deprecated — use ZRANGE BYSCORE.\n\n**Group:** Sorted Sets",
956
- "ZRANGEBYLEX": "## ZRANGEBYLEX\n\n```redis\nZRANGEBYLEX key min max [LIMIT offset count]\n```\n\nReturn members in a lex range. Deprecated — use ZRANGE BYLEX.\n\n**Group:** Sorted Sets",
957
- "ZREVRANGE": "## ZREVRANGE\n\n```redis\nZREVRANGE key start stop [WITHSCORES]\n```\n\nReturn members in reverse rank order. Deprecated — use ZRANGE REV.\n\n**Group:** Sorted Sets",
958
- "ZREVRANGEBYSCORE": "## ZREVRANGEBYSCORE\n\n```redis\nZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]\n```\n\nReturn members with scores in range, descending. Deprecated.\n\n**Group:** Sorted Sets",
959
- "ZUNION": "## ZUNION\n\n```redis\nZUNION numkeys key [key ...] [WEIGHTS w ...] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]\n```\n\nReturn union without storing. Redis 6.2+.\n\n**Group:** Sorted Sets",
960
- "ZINTER": "## ZINTER\n\n```redis\nZINTER numkeys key [key ...] [WEIGHTS w ...] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]\n```\n\nReturn intersection without storing. Redis 6.2+.\n\n**Group:** Sorted Sets",
961
- "ZDIFFSTORE": "## ZDIFFSTORE\n\n```redis\nZDIFFSTORE dest numkeys key [key ...]\n```\n\nStore difference of sorted sets. Redis 6.2+.\n\n**Group:** Sorted Sets",
962
- "ZDIFF": "## ZDIFF\n\n```redis\nZDIFF numkeys key [key ...] [WITHSCORES]\n```\n\nReturn difference without storing. Redis 6.2+.\n\n**Group:** Sorted Sets",
963
- "ZRANDMEMBER": "## ZRANDMEMBER\n\n```redis\nZRANDMEMBER key [count [WITHSCORES]]\n```\n\nReturn random member(s). Redis 6.2+.\n\n**Group:** Sorted Sets",
964
- "BZPOPMIN": "## BZPOPMIN\n\n```redis\nBZPOPMIN key [key ...] timeout\n```\n\nBlocking pop of member with lowest score.\n\n**Group:** Sorted Sets",
965
- "BZPOPMAX": "## BZPOPMAX\n\n```redis\nBZPOPMAX key [key ...] timeout\n```\n\nBlocking pop of member with highest score.\n\n**Group:** Sorted Sets",
966
- "ZMPOP": "## ZMPOP\n\n```redis\nZMPOP numkeys key [key ...] MIN|MAX [COUNT count]\n```\n\nPop from first non-empty sorted set. Redis 7.0+.\n\n**Group:** Sorted Sets",
967
- "BZMPOP": "## BZMPOP\n\n```redis\nBZMPOP timeout numkeys key [key ...] MIN|MAX [COUNT count]\n```\n\nBlocking version of ZMPOP. Redis 7.0+.\n\n**Group:** Sorted Sets",
968
- "ZRANGESTORE": "## ZRANGESTORE\n\n```redis\nZRANGESTORE dst src min max [BYSCORE|BYLEX] [REV] [LIMIT offset count]\n```\n\nStore specified range from sorted set. Redis 6.2+.\n\n**Group:** Sorted Sets",
969
- "ZSCAN": "## ZSCAN\n\n```redis\nZSCAN key cursor [MATCH pattern] [COUNT count]\n```\n\nIncrementally iterate sorted set members and scores.\n\n**Group:** Sorted Sets",
970
- "RENAMENX": "## RENAMENX\n\n```redis\nRENAMENX key newkey\n```\n\nRename key only if newkey does not exist.\n\n**Group:** Generic",
971
- "PEXPIRE": "## PEXPIRE\n\n```redis\nPEXPIRE key milliseconds [NX|XX|GT|LT]\n```\n\nSet TTL on key in milliseconds.\n\n**Group:** Generic",
972
- "EXPIREAT": "## EXPIREAT\n\n```redis\nEXPIREAT key unix-time-seconds [NX|XX|GT|LT]\n```\n\nSet key to expire at a Unix timestamp (seconds).\n\n**Group:** Generic",
973
- "PEXPIREAT": "## PEXPIREAT\n\n```redis\nPEXPIREAT key unix-time-milliseconds [NX|XX|GT|LT]\n```\n\nSet key to expire at a Unix timestamp (milliseconds).\n\n**Group:** Generic",
974
- "EXPIRETIME": "## EXPIRETIME\n\n```redis\nEXPIRETIME key\n```\n\nReturns the absolute Unix timestamp at which the key will expire. Redis 7.0+.\n\n**Group:** Generic",
975
- "PEXPIRETIME": "## PEXPIRETIME\n\n```redis\nPEXPIRETIME key\n```\n\nReturns the absolute Unix timestamp (ms) at which the key will expire. Redis 7.0+.\n\n**Group:** Generic",
976
- "SORT_RO": "## SORT_RO\n\n```redis\nSORT_RO key [BY pattern] [LIMIT offset count] [GET pattern ...] [ASC|DESC] [ALPHA]\n```\n\nRead-only variant of SORT. Redis 7.0+.\n\n**Group:** Generic",
977
- "MOVE": "## MOVE\n\n```redis\nMOVE key db\n```\n\nMove key to another database.\n\n**Group:** Generic",
978
- "TOUCH": "## TOUCH\n\n```redis\nTOUCH key [key ...]\n```\n\nAlter the last access time of key(s).\n\n**Group:** Generic",
979
- "WAIT": "## WAIT\n\n```redis\nWAIT numreplicas timeout\n```\n\nBlock until writes are acknowledged by N replicas or timeout.\n\n**Group:** Generic",
980
- "BITFIELD_RO": "## BITFIELD_RO\n\n```redis\nBITFIELD_RO key GET type offset [GET type offset ...]\n```\n\nRead-only variant of BITFIELD. Redis 6.0+.\n\n**Group:** Bitmaps",
981
- "XRANGE": "## XRANGE\n\n```redis\nXRANGE key start end [COUNT count]\n```\n\nReturn entries in a range. Use - and + for min/max IDs.\n\n**Group:** Streams",
982
- "XREVRANGE": "## XREVRANGE\n\n```redis\nXREVRANGE key end start [COUNT count]\n```\n\nReturn entries in reverse order.\n\n**Group:** Streams",
983
- "XGROUP DESTROY": "## XGROUP DESTROY\n\n```redis\nXGROUP DESTROY key group\n```\n\nDestroy a consumer group.\n\n**Group:** Streams",
984
- "XGROUP DELCONSUMER": "## XGROUP DELCONSUMER\n\n```redis\nXGROUP DELCONSUMER key group consumer\n```\n\nRemove a consumer from a group.\n\n**Group:** Streams",
985
- "XGROUP SETID": "## XGROUP SETID\n\n```redis\nXGROUP SETID key group id|$ [ENTRIESREAD n]\n```\n\nSet the last delivered ID of a consumer group.\n\n**Group:** Streams",
986
- "XINFO GROUPS": "## XINFO GROUPS\n\n```redis\nXINFO GROUPS key\n```\n\nList consumer groups for a stream.\n\n**Group:** Streams",
987
- "XINFO CONSUMERS": "## XINFO CONSUMERS\n\n```redis\nXINFO CONSUMERS key group\n```\n\nList consumers in a consumer group.\n\n**Group:** Streams",
988
- "XDEL": "## XDEL\n\n```redis\nXDEL key id [id ...]\n```\n\nDelete specific entries from a stream by ID.\n\n**Group:** Streams",
989
- "XSETID": "## XSETID\n\n```redis\nXSETID key last-id [ENTRIESADDED n] [MAXDELETEDID id]\n```\n\nSet the last entry ID of a stream.\n\n**Group:** Streams",
990
- "UNSUBSCRIBE": "## UNSUBSCRIBE\n\n```redis\nUNSUBSCRIBE [channel ...]\n```\n\nStop listening from channels.\n\n**Group:** Pub/Sub",
991
- "PUNSUBSCRIBE": "## PUNSUBSCRIBE\n\n```redis\nPUNSUBSCRIBE [pattern ...]\n```\n\nStop listening from pattern channels.\n\n**Group:** Pub/Sub",
992
- "PUBSUB CHANNELS": "## PUBSUB CHANNELS\n\n```redis\nPUBSUB CHANNELS [pattern]\n```\n\nList active channels. Optionally filter by pattern.\n\n**Group:** Pub/Sub",
993
- "PUBSUB NUMSUB": "## PUBSUB NUMSUB\n\n```redis\nPUBSUB NUMSUB [channel ...]\n```\n\nGet subscriber counts for channels.\n\n**Group:** Pub/Sub",
994
- "PUBSUB NUMPAT": "## PUBSUB NUMPAT\n\n```redis\nPUBSUB NUMPAT\n```\n\nGet the count of unique pattern subscriptions.\n\n**Group:** Pub/Sub",
995
- "SSUBSCRIBE": "## SSUBSCRIBE\n\n```redis\nSSUBSCRIBE channel [channel ...]\n```\n\nSubscribe to shard channels. Redis 7.0+.\n\n**Group:** Pub/Sub",
996
- "SUNSUBSCRIBE": "## SUNSUBSCRIBE\n\n```redis\nSUNSUBSCRIBE [channel ...]\n```\n\nUnsubscribe from shard channels. Redis 7.0+.\n\n**Group:** Pub/Sub",
997
- "SPUBLISH": "## SPUBLISH\n\n```redis\nSPUBLISH channel message\n```\n\nPublish to a shard channel. Redis 7.0+.\n\n**Group:** Pub/Sub",
998
- "PUBSUB SHARDCHANNELS": "## PUBSUB SHARDCHANNELS\n\n```redis\nPUBSUB SHARDCHANNELS [pattern]\n```\n\nList active shard channels. Redis 7.0+.\n\n**Group:** Pub/Sub",
999
- "PUBSUB SHARDNUMSUB": "## PUBSUB SHARDNUMSUB\n\n```redis\nPUBSUB SHARDNUMSUB [channel ...]\n```\n\nGet shard channel subscriber counts. Redis 7.0+.\n\n**Group:** Pub/Sub",
1000
- "UNWATCH": "## UNWATCH\n\n```redis\nUNWATCH\n```\n\nForget all watched keys.\n\n**Group:** Transactions",
1001
- "EVALRO": "## EVALRO\n\n```redis\nEVALRO script numkeys [key ...] [arg ...]\n```\n\nExecute Lua script in read-only mode. Redis 7.0+.\n\n**Group:** Scripting",
1002
- "EVALSHA_RO": "## EVALSHA_RO\n\n```redis\nEVALSHA_RO sha1 numkeys [key ...] [arg ...]\n```\n\nExecute cached script in read-only mode. Redis 7.0+.\n\n**Group:** Scripting",
1003
- "SCRIPT LOAD": "## SCRIPT LOAD\n\n```redis\nSCRIPT LOAD script\n```\n\nLoad a Lua script into the script cache. Returns SHA1 hash.\n\n**Group:** Scripting",
1004
- "SCRIPT EXISTS": "## SCRIPT EXISTS\n\n```redis\nSCRIPT EXISTS sha1 [sha1 ...]\n```\n\nCheck if scripts exist in the script cache.\n\n**Group:** Scripting",
1005
- "SCRIPT FLUSH": "## SCRIPT FLUSH\n\n```redis\nSCRIPT FLUSH [ASYNC|SYNC]\n```\n\nRemove all scripts from the script cache.\n\n**Group:** Scripting",
1006
- "SCRIPT KILL": "## SCRIPT KILL\n\n```redis\nSCRIPT KILL\n```\n\nKill the currently executing Lua script.\n\n**Group:** Scripting",
1007
- "FCALL_RO": "## FCALL_RO\n\n```redis\nFCALL_RO function numkeys [key ...] [arg ...]\n```\n\nCall a function in read-only mode. Redis 7.0+.\n\n**Group:** Scripting",
1008
- "FUNCTION DUMP": "## FUNCTION DUMP\n\n```redis\nFUNCTION DUMP\n```\n\nSerialize all loaded functions. Redis 7.0+.\n\n**Group:** Scripting",
1009
- "FUNCTION RESTORE": "## FUNCTION RESTORE\n\n```redis\nFUNCTION RESTORE serialized-data [FLUSH|APPEND|REPLACE]\n```\n\nRestore functions from FUNCTION DUMP. Redis 7.0+.\n\n**Group:** Scripting",
1010
- "FUNCTION FLUSH": "## FUNCTION FLUSH\n\n```redis\nFUNCTION FLUSH [ASYNC|SYNC]\n```\n\nDelete all loaded functions. Redis 7.0+.\n\n**Group:** Scripting",
1011
- "FUNCTION DELETE": "## FUNCTION DELETE\n\n```redis\nFUNCTION DELETE library-name\n```\n\nDelete a function library. Redis 7.0+.\n\n**Group:** Scripting",
1012
- "FUNCTION STATS": "## FUNCTION STATS\n\n```redis\nFUNCTION STATS\n```\n\nGet function execution statistics. Redis 7.0+.\n\n**Group:** Scripting",
1013
- "GEOHASH": "## GEOHASH\n\n```redis\nGEOHASH key member [member ...]\n```\n\nReturn Geohash strings representing positions.\n\n**Group:** Geo",
1014
- "GEOPOS": "## GEOPOS\n\n```redis\nGEOPOS key member [member ...]\n```\n\nReturn longitude/latitude of members.\n\n**Group:** Geo",
1015
- "GEOSEARCHSTORE": "## GEOSEARCHSTORE\n\n```redis\nGEOSEARCHSTORE dest src FROMMEMBER member|FROMLONLAT lon lat BYRADIUS ...|BYBOX ... [ASC|DESC] [COUNT n] [STOREDIST]\n```\n\nStore GEOSEARCH results. Redis 6.2+.\n\n**Group:** Geo",
1016
- "GEORADIUS": "## GEORADIUS\n\n```redis\nGEORADIUS key longitude latitude radius M|KM|FT|MI [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT n] [ASC|DESC] [STORE key] [STOREDIST key]\n```\n\nQuery by radius from coordinates. Deprecated — use GEOSEARCH.\n\n**Group:** Geo",
1017
- "GEORADIUSBYMEMBER": "## GEORADIUSBYMEMBER\n\n```redis\nGEORADIUSBYMEMBER key member radius M|KM|FT|MI ...\n```\n\nQuery by radius from a member. Deprecated — use GEOSEARCH.\n\n**Group:** Geo",
1018
- "CONFIG RESETSTAT": "## CONFIG RESETSTAT\n\n```redis\nCONFIG RESETSTAT\n```\n\nReset the statistics returned by INFO.\n\n**Group:** Server",
1019
- "CONFIG REWRITE": "## CONFIG REWRITE\n\n```redis\nCONFIG REWRITE\n```\n\nRewrite the redis.conf file with current in-memory configuration.\n\n**Group:** Server",
1020
- "BGREWRITEAOF": "## BGREWRITEAOF\n\n```redis\nBGREWRITEAOF\n```\n\nTrigger an asynchronous AOF rewrite.\n\n**Group:** Server",
1021
- "SAVE": "## SAVE\n\n```redis\nSAVE\n```\n\nSynchronously save the dataset to disk. BLOCKS the server.\n\n**Group:** Server",
1022
- "LASTSAVE": "## LASTSAVE\n\n```redis\nLASTSAVE\n```\n\nReturn the Unix timestamp of the last successful RDB save.\n\n**Group:** Server",
1023
- "SHUTDOWN": "## SHUTDOWN\n\n```redis\nSHUTDOWN [NOSAVE|SAVE] [NOW] [FORCE]\n```\n\nSynchronously save (unless NOSAVE) and shut down the server.\n\n**Group:** Server",
1024
- "SLOWLOG LEN": "## SLOWLOG LEN\n\n```redis\nSLOWLOG LEN\n```\n\nGet the number of entries in the slow log.\n\n**Group:** Server",
1025
- "SLOWLOG RESET": "## SLOWLOG RESET\n\n```redis\nSLOWLOG RESET\n```\n\nReset the slow log.\n\n**Group:** Server",
1026
- "TIME": "## TIME\n\n```redis\nTIME\n```\n\nReturn the current server time as [unix-seconds, microseconds].\n\n**Group:** Server",
1027
- "CLIENT ID": "## CLIENT ID\n\n```redis\nCLIENT ID\n```\n\nReturn the ID of the current connection.\n\n**Group:** Server",
1028
- "CLIENT GETNAME": "## CLIENT GETNAME\n\n```redis\nCLIENT GETNAME\n```\n\nGet the name of the current connection.\n\n**Group:** Server",
1029
- "CLIENT PAUSE": "## CLIENT PAUSE\n\n```redis\nCLIENT PAUSE timeout [WRITE|ALL]\n```\n\nPause all clients for timeout milliseconds.\n\n**Group:** Server",
1030
- "CLIENT UNPAUSE": "## CLIENT UNPAUSE\n\n```redis\nCLIENT UNPAUSE\n```\n\nResume client processing after CLIENT PAUSE.\n\n**Group:** Server",
1031
- "CLIENT NO-EVICT": "## CLIENT NO-EVICT\n\n```redis\nCLIENT NO-EVICT ON|OFF\n```\n\nExempt current connection from client eviction. Redis 7.0+.\n\n**Group:** Server",
1032
- "CLIENT NO-TOUCH": "## CLIENT NO-TOUCH\n\n```redis\nCLIENT NO-TOUCH ON|OFF\n```\n\nDon't update key access time for current connection. Redis 7.2+.\n\n**Group:** Server",
1033
- "ECHO": "## ECHO\n\n```redis\nECHO message\n```\n\nEcho the given message back.\n\n**Group:** Server",
1034
- "SWAPDB": "## SWAPDB\n\n```redis\nSWAPDB db1 db2\n```\n\nSwap two Redis databases atomically.\n\n**Group:** Server",
1035
- "MEMORY STATS": "## MEMORY STATS\n\n```redis\nMEMORY STATS\n```\n\nGet detailed memory statistics.\n\n**Group:** Server",
1036
- "MEMORY PURGE": "## MEMORY PURGE\n\n```redis\nMEMORY PURGE\n```\n\nAsk allocator to release memory.\n\n**Group:** Server",
1037
- "MEMORY MALLOC-STATS": "## MEMORY MALLOC-STATS\n\n```redis\nMEMORY MALLOC-STATS\n```\n\nShow internal allocator statistics.\n\n**Group:** Server",
1038
- "LATENCY RESET": "## LATENCY RESET\n\n```redis\nLATENCY RESET [event ...]\n```\n\nReset latency data for events.\n\n**Group:** Server",
1039
- "LATENCY GRAPH": "## LATENCY GRAPH\n\n```redis\nLATENCY GRAPH event\n```\n\nRender an ASCII art latency graph for an event.\n\n**Group:** Server",
1040
- "COMMAND COUNT": "## COMMAND COUNT\n\n```redis\nCOMMAND COUNT\n```\n\nGet total number of commands supported by the server.\n\n**Group:** Server",
1041
- "COMMAND LIST": "## COMMAND LIST\n\n```redis\nCOMMAND LIST [MODULE module] [ACLCAT cat] [PATTERN pattern]\n```\n\nList all command names.\n\n**Group:** Server",
1042
- "COMMAND INFO": "## COMMAND INFO\n\n```redis\nCOMMAND INFO [command ...]\n```\n\nGet details about specific commands.\n\n**Group:** Server",
1043
- "COMMAND GETKEYS": "## COMMAND GETKEYS\n\n```redis\nCOMMAND GETKEYS command [arg ...]\n```\n\nExtract keys from a full command.\n\n**Group:** Server",
1044
- "COMMAND DOCS": "## COMMAND DOCS\n\n```redis\nCOMMAND DOCS [command ...]\n```\n\nGet documentation for commands. Redis 7.0+.\n\n**Group:** Server",
1045
- "ACL LIST": "## ACL LIST\n\n```redis\nACL LIST\n```\n\nList all users and their ACL rules.\n\n**Group:** ACL",
1046
- "ACL USERS": "## ACL USERS\n\n```redis\nACL USERS\n```\n\nList all configured usernames.\n\n**Group:** ACL",
1047
- "ACL WHOAMI": "## ACL WHOAMI\n\n```redis\nACL WHOAMI\n```\n\nReturn the username of the current connection.\n\n**Group:** ACL",
1048
- "ACL LOG": "## ACL LOG\n\n```redis\nACL LOG [count|RESET]\n```\n\nShow recent security events (failed auth, denied commands).\n\n**Group:** ACL",
1049
- "ACL SAVE": "## ACL SAVE\n\n```redis\nACL SAVE\n```\n\nSave the current ACL rules to the configured ACL file.\n\n**Group:** ACL",
1050
- "ACL LOAD": "## ACL LOAD\n\n```redis\nACL LOAD\n```\n\nLoad ACL rules from the configured ACL file.\n\n**Group:** ACL",
1051
- "CLUSTER MYID": "## CLUSTER MYID\n\n```redis\nCLUSTER MYID\n```\n\nReturn the node's cluster ID.\n\n**Group:** Cluster",
1052
- "CLUSTER SLOTS": "## CLUSTER SLOTS\n\n```redis\nCLUSTER SLOTS\n```\n\nGet mapping of hash slots to nodes. Deprecated — use CLUSTER SHARDS.\n\n**Group:** Cluster",
1053
- "CLUSTER SHARDS": "## CLUSTER SHARDS\n\n```redis\nCLUSTER SHARDS\n```\n\nGet detailed shard information. Redis 7.0+.\n\n**Group:** Cluster",
1054
- "CLUSTER MEET": "## CLUSTER MEET\n\n```redis\nCLUSTER MEET ip port\n```\n\nAdd a node to the cluster.\n\n**Group:** Cluster",
1055
- "CLUSTER FORGET": "## CLUSTER FORGET\n\n```redis\nCLUSTER FORGET node-id\n```\n\nRemove a node from the cluster's known nodes.\n\n**Group:** Cluster",
1056
- "CLUSTER REPLICATE": "## CLUSTER REPLICATE\n\n```redis\nCLUSTER REPLICATE node-id\n```\n\nMake current node a replica of the specified master.\n\n**Group:** Cluster",
1057
- "CLUSTER RESET": "## CLUSTER RESET\n\n```redis\nCLUSTER RESET [HARD|SOFT]\n```\n\nReset the cluster configuration of the node.\n\n**Group:** Cluster",
1058
- "CLUSTER DELSLOTS": "## CLUSTER DELSLOTS\n\n```redis\nCLUSTER DELSLOTS slot [slot ...]\n```\n\nRemove hash slots from this node.\n\n**Group:** Cluster",
1059
- "CLUSTER SETSLOT": "## CLUSTER SETSLOT\n\n```redis\nCLUSTER SETSLOT slot IMPORTING|MIGRATING|NODE|STABLE [node-id]\n```\n\nBind, migrate, or stabilize a hash slot.\n\n**Group:** Cluster",
1060
- "CLUSTER COUNTKEYSINSLOT": "## CLUSTER COUNTKEYSINSLOT\n\n```redis\nCLUSTER COUNTKEYSINSLOT slot\n```\n\nCount keys in a specific hash slot.\n\n**Group:** Cluster",
1061
- "CLUSTER GETKEYSINSLOT": "## CLUSTER GETKEYSINSLOT\n\n```redis\nCLUSTER GETKEYSINSLOT slot count\n```\n\nReturn keys assigned to a hash slot.\n\n**Group:** Cluster",
1062
- "CLUSTER KEYSLOT": "## CLUSTER KEYSLOT\n\n```redis\nCLUSTER KEYSLOT key\n```\n\nReturn the hash slot number for a key.\n\n**Group:** Cluster",
1063
- "CLUSTER LINKS": "## CLUSTER LINKS\n\n```redis\nCLUSTER LINKS\n```\n\nList cluster bus connections. Redis 7.0+.\n\n**Group:** Cluster",
1064
- "CLUSTER FLUSHSLOTS": "## CLUSTER FLUSHSLOTS\n\n```redis\nCLUSTER FLUSHSLOTS\n```\n\nDelete all slot assignments from this node.\n\n**Group:** Cluster",
1065
- "CLUSTER SAVECONFIG": "## CLUSTER SAVECONFIG\n\n```redis\nCLUSTER SAVECONFIG\n```\n\nSave the cluster configuration to nodes.conf.\n\n**Group:** Cluster",
1066
- "READONLY": "## READONLY\n\n```redis\nREADONLY\n```\n\nEnable read queries on a cluster replica. Allows reading from replicas.\n\n**Group:** Cluster",
1067
- "READWRITE": "## READWRITE\n\n```redis\nREADWRITE\n```\n\nDisable READONLY mode. Replica rejects read queries.\n\n**Group:** Cluster",
1068
- "SLAVEOF": "## SLAVEOF\n\n```redis\nSLAVEOF host port | SLAVEOF NO ONE\n```\n\nLegacy alias for REPLICAOF.\n\n**Group:** Replication",
1069
- "FAILOVER": "## FAILOVER\n\n```redis\nFAILOVER [TO host port [FORCE]] [ABORT] [TIMEOUT ms]\n```\n\nCoordinated failover to a replica. Redis 6.2+.\n\n**Group:** Replication",
1070
- "MODULE LOAD": "## MODULE LOAD\n\n```redis\nMODULE LOAD path [arg ...]\n```\n\nLoad a Redis module from a shared library.\n\n**Group:** Modules",
1071
- "MODULE LIST": "## MODULE LIST\n\n```redis\nMODULE LIST\n```\n\nList all loaded modules.\n\n**Group:** Modules",
1072
- "MODULE UNLOAD": "## MODULE UNLOAD\n\n```redis\nMODULE UNLOAD name\n```\n\nUnload a loaded Redis module.\n\n**Group:** Modules",
1073
- "MODULE LOADEX": "## MODULE LOADEX\n\n```redis\nMODULE LOADEX path [CONFIG name value ...] [ARGS arg ...]\n```\n\nLoad module with configuration. Redis 7.0+.\n\n**Group:** Modules",
1074
- "MIGRATE": "## MIGRATE\n\n```redis\nMIGRATE host port key|\"\" db timeout [COPY] [REPLACE] [AUTH password] [AUTH2 username password] [KEYS key ...]\n```\n\nAtomically transfer a key to another Redis instance.\n\n**Group:** Generic",
1075
- "RESET": "## RESET\n\n```redis\nRESET\n```\n\nReset the connection state to default.\n\n**Group:** Connection",
1076
- "QUIT": "## QUIT\n\n```redis\nQUIT\n```\n\nClose the connection. Client should close after receiving OK.\n\n**Group:** Connection",
1077
- "HELLO": "## HELLO\n\n```redis\nHELLO [protover [AUTH username password] [SETNAME clientname]]\n```\n\nSwitch RESP protocol version (2 or 3). Redis 6.0+.\n\n**Group:** Connection",
1078
- "string": "## string\n\n```redis\nRedis String\n```\n\nThe most basic Redis data type. A string value can be at most 512 MB. Used for caching, counters, sessions, and general key-value storage.\n\n**Group:** Data Types",
1079
- "list": "## list\n\n```redis\nRedis List\n```\n\nOrdered collection of strings. Implemented as linked list. Supports push/pop from both ends. Used for queues, stacks, and recent-items lists.\n\n**Group:** Data Types",
1080
- "set": "## set\n\n```redis\nRedis Set\n```\n\nUnordered collection of unique strings. Supports add, remove, membership test, and set operations (union, intersection, difference).\n\n**Group:** Data Types",
1081
- "zset": "## zset\n\n```redis\nRedis Sorted Set\n```\n\nSet of unique strings ordered by a floating-point score. Supports range queries by score or rank. Used for leaderboards, rate limiters, priority queues.\n\n**Group:** Data Types",
1082
- "hash": "## hash\n\n```redis\nRedis Hash\n```\n\nMap of field-value pairs. Memory-efficient for representing objects. Each hash can store over 4 billion field-value pairs.\n\n**Group:** Data Types",
1083
- "stream": "## stream\n\n```redis\nRedis Stream\n```\n\nAppend-only log data structure. Supports consumer groups for reliable message processing. Used for event sourcing, message queues, activity feeds.\n\n**Group:** Data Types",
1084
- "hyperloglog": "## hyperloglog\n\n```redis\nRedis HyperLogLog\n```\n\nProbabilistic data structure for approximate cardinality counting. Uses ~12 KB regardless of set size. 0.81% standard error.\n\n**Group:** Data Types",
1085
- "bitmap": "## bitmap\n\n```redis\nRedis Bitmap\n```\n\nString type interpreted as an array of bits. Space-efficient for storing boolean information across a large key space.\n\n**Group:** Data Types",
1086
- "geospatial": "## geospatial\n\n```redis\nRedis Geospatial Index\n```\n\nSorted set with geohash-encoded coordinates. Supports radius/box queries, distance calculations. Built on sorted sets internally.\n\n**Group:** Data Types"
1087
- }
1088
- }
1
+ {
2
+ "language": "redis-cli",
3
+ "hovers": {
4
+ "SET": {
5
+ "contents": [
6
+ {
7
+ "value": "```redis\nSET key value [EX seconds] [PX ms] [EXAT ts] [PXAT ms-ts] [NX|XX] [KEEPTTL] [GET]\n```\n**SET** assigns a string value to a key. Options:\n- `EX`/`PX` — set TTL in seconds/milliseconds\n- `NX` — only set if key does **not** exist (distributed lock)\n- `XX` — only set if key **already** exists\n- `GET` — return the old value (Redis 6.2+)\n- `KEEPTTL` — retain existing TTL\n\n```redis\nSET session:abc \"token\" EX 3600 NX\nSET counter 0\nSET key val XX GET\n```\nTime complexity: **O(1)**"
8
+ }
9
+ ]
10
+ },
11
+ "GET": {
12
+ "contents": [
13
+ {
14
+ "value": "```redis\nGET key\n```\n**GET** returns the string value of `key`. Returns `nil` if the key does not exist. Returns an error if the value is not a string.\n\n```redis\nSET greeting \"hello\"\nGET greeting # => \"hello\"\nGET nonexistent # => (nil)\n```\nTime complexity: **O(1)**"
15
+ }
16
+ ]
17
+ },
18
+ "MSET": {
19
+ "contents": [
20
+ {
21
+ "value": "```redis\nMSET key1 value1 [key2 value2 ...]\n```\n**MSET** sets multiple key-value pairs atomically. Never fails — always OK.\n\n```redis\nMSET first \"Hello\" second \"World\"\nMGET first second # => \"Hello\" \"World\"\n```\nTime complexity: **O(N)** where N is the number of keys"
22
+ }
23
+ ]
24
+ },
25
+ "MGET": {
26
+ "contents": [
27
+ {
28
+ "value": "```redis\nMGET key1 [key2 ...]\n```\n**MGET** returns values for all specified keys. Non-existing keys return `nil`.\n\n```redis\nMGET key1 key2 key3\n# => \"val1\" (nil) \"val3\"\n```\nTime complexity: **O(N)**"
29
+ }
30
+ ]
31
+ },
32
+ "INCR": {
33
+ "contents": [
34
+ {
35
+ "value": "```redis\nINCR key\n```\n**INCR** atomically increments the integer stored at `key` by 1. If the key does not exist, it's set to 0 before incrementing. Returns the new value.\n\n```redis\nSET counter 10\nINCR counter # => 11\nINCR newcounter # => 1\n```\nTime complexity: **O(1)**. Common for counters, rate limiters."
36
+ }
37
+ ]
38
+ },
39
+ "INCRBY": {
40
+ "contents": [
41
+ {
42
+ "value": "```redis\nINCRBY key increment\n```\n**INCRBY** atomically increments the integer at `key` by the given amount. Can be negative for decrements.\n\n```redis\nSET counter 10\nINCRBY counter 5 # => 15\nINCRBY counter -3 # => 12\n```\nTime complexity: **O(1)**"
43
+ }
44
+ ]
45
+ },
46
+ "DECR": {
47
+ "contents": [
48
+ {
49
+ "value": "```redis\nDECR key\n```\n**DECR** atomically decrements the integer at `key` by 1.\n\n```redis\nSET counter 10\nDECR counter # => 9\n```\nTime complexity: **O(1)**"
50
+ }
51
+ ]
52
+ },
53
+ "APPEND": {
54
+ "contents": [
55
+ {
56
+ "value": "```redis\nAPPEND key value\n```\n**APPEND** appends `value` to the existing string at `key`. Creates the key if it doesn't exist. Returns the length of the string after appending.\n\n```redis\nAPPEND mykey \"Hello\"\nAPPEND mykey \" World\"\nGET mykey # => \"Hello World\"\n```\nTime complexity: **O(1)** amortized"
57
+ }
58
+ ]
59
+ },
60
+ "STRLEN": {
61
+ "contents": [
62
+ {
63
+ "value": "```redis\nSTRLEN key\n```\n**STRLEN** returns the length of the string stored at `key`. Returns 0 if the key doesn't exist.\n\n```redis\nSET mykey \"Hello World\"\nSTRLEN mykey # => 11\n```\nTime complexity: **O(1)**"
64
+ }
65
+ ]
66
+ },
67
+ "GETRANGE": {
68
+ "contents": [
69
+ {
70
+ "value": "```redis\nGETRANGE key start end\n```\n**GETRANGE** returns a substring of the string at `key`. Negative offsets count from the end.\n\n```redis\nSET mykey \"Hello, World\"\nGETRANGE mykey 0 4 # => \"Hello\"\nGETRANGE mykey -5 -1 # => \"World\"\n```\nTime complexity: **O(N)** where N is the length of the returned string"
71
+ }
72
+ ]
73
+ },
74
+ "SETEX": {
75
+ "contents": [
76
+ {
77
+ "value": "```redis\nSETEX key seconds value\n```\n**SETEX** sets `key` to `value` with an expiration in seconds. Atomic equivalent of `SET key value` + `EXPIRE key seconds`.\n\n```redis\nSETEX session 3600 \"data\"\nTTL session # => 3600\n```\nTime complexity: **O(1)**"
78
+ }
79
+ ]
80
+ },
81
+ "SETNX": {
82
+ "contents": [
83
+ {
84
+ "value": "```redis\nSETNX key value\n```\n**SETNX** (SET if Not eXists) sets `key` to `value` only if it doesn't already exist. Returns 1 if set, 0 otherwise.\n\n```redis\nSETNX mykey \"Hello\" # => 1\nSETNX mykey \"World\" # => 0 (key exists)\n```\n**Note**: For distributed locks, prefer `SET key value NX EX seconds`.\nTime complexity: **O(1)**"
85
+ }
86
+ ]
87
+ },
88
+ "GETDEL": {
89
+ "contents": [
90
+ {
91
+ "value": "```redis\nGETDEL key\n```\n**GETDEL** gets the value and deletes the key atomically (Redis 6.2+).\n\n```redis\nSET temp \"data\"\nGETDEL temp # => \"data\"\nGET temp # => (nil)\n```\nTime complexity: **O(1)**"
92
+ }
93
+ ]
94
+ },
95
+ "GETEX": {
96
+ "contents": [
97
+ {
98
+ "value": "```redis\nGETEX key [EX seconds | PX ms | EXAT ts | PXAT ms-ts | PERSIST]\n```\n**GETEX** gets the value and optionally sets/removes its expiration (Redis 6.2+).\n\n```redis\nGETEX mykey EX 100 # Get and set 100s TTL\nGETEX mykey PERSIST # Get and remove TTL\n```\nTime complexity: **O(1)**"
99
+ }
100
+ ]
101
+ },
102
+ "INCRBYFLOAT": {
103
+ "contents": [
104
+ {
105
+ "value": "```redis\nINCRBYFLOAT key increment\n```\n**INCRBYFLOAT** increments the floating point number stored at `key`.\n\n```redis\nSET price 10.50\nINCRBYFLOAT price 0.1 # => \"10.6\"\nINCRBYFLOAT price -5 # => \"5.6\"\n```\nTime complexity: **O(1)**"
106
+ }
107
+ ]
108
+ },
109
+ "LCS": {
110
+ "contents": [
111
+ {
112
+ "value": "```redis\nLCS key1 key2 [LEN] [IDX] [MINMATCHLEN len] [WITHMATCHLEN]\n```\n**LCS** finds the Longest Common Substring between two string keys (Redis 7.0+).\n\n```redis\nSET key1 \"ohmytext\" \nSET key2 \"mynewtext\"\nLCS key1 key2 # => \"mytext\"\nLCS key1 key2 LEN # => 6\n```\nTime complexity: **O(N*M)** where N and M are string lengths"
113
+ }
114
+ ]
115
+ },
116
+ "HSET": {
117
+ "contents": [
118
+ {
119
+ "value": "```redis\nHSET key field value [field value ...]\n```\n**HSET** sets field(s) in a hash. Creates the hash if it doesn't exist. Returns the number of new fields added.\n\n```redis\nHSET user:1 name \"Alice\" age \"30\" email \"alice@example.com\"\nHGET user:1 name # => \"Alice\"\n```\nTime complexity: **O(N)** where N is number of field-value pairs"
120
+ }
121
+ ]
122
+ },
123
+ "HGET": {
124
+ "contents": [
125
+ {
126
+ "value": "```redis\nHGET key field\n```\n**HGET** returns the value of a field in a hash. Returns `nil` if field or key doesn't exist.\n\n```redis\nHSET user:1 name \"Alice\"\nHGET user:1 name # => \"Alice\"\nHGET user:1 missing # => (nil)\n```\nTime complexity: **O(1)**"
127
+ }
128
+ ]
129
+ },
130
+ "HGETALL": {
131
+ "contents": [
132
+ {
133
+ "value": "```redis\nHGETALL key\n```\n**HGETALL** returns all fields and values in a hash as a flat list.\n\n```redis\nHSET user:1 name \"Alice\" age \"30\"\nHGETALL user:1\n# => 1) \"name\" 2) \"Alice\" 3) \"age\" 4) \"30\"\n```\n**Warning**: For large hashes, consider `HSCAN`.\nTime complexity: **O(N)**"
134
+ }
135
+ ]
136
+ },
137
+ "HDEL": {
138
+ "contents": [
139
+ {
140
+ "value": "```redis\nHDEL key field [field ...]\n```\n**HDEL** removes fields from a hash. Returns the number of fields removed.\n\n```redis\nHDEL user:1 age email\n```\nTime complexity: **O(N)** where N is number of fields to remove"
141
+ }
142
+ ]
143
+ },
144
+ "HEXISTS": {
145
+ "contents": [
146
+ {
147
+ "value": "```redis\nHEXISTS key field\n```\n**HEXISTS** checks if a field exists in a hash. Returns 1 if exists, 0 otherwise.\n\n```redis\nHEXISTS user:1 name # => 1\nHEXISTS user:1 missing # => 0\n```\nTime complexity: **O(1)**"
148
+ }
149
+ ]
150
+ },
151
+ "HMSET": {
152
+ "contents": [
153
+ {
154
+ "value": "```redis\nHMSET key field value [field value ...]\n```\n**HMSET** sets multiple fields in a hash. **Deprecated** in favor of `HSET` which now accepts multiple field-value pairs.\n\n```redis\nHMSET user:1 name \"Alice\" age \"30\"\n```\nTime complexity: **O(N)**"
155
+ }
156
+ ]
157
+ },
158
+ "HMGET": {
159
+ "contents": [
160
+ {
161
+ "value": "```redis\nHMGET key field [field ...]\n```\n**HMGET** returns values for multiple fields. Non-existing fields return `nil`.\n\n```redis\nHMGET user:1 name age missing\n# => \"Alice\" \"30\" (nil)\n```\nTime complexity: **O(N)**"
162
+ }
163
+ ]
164
+ },
165
+ "HINCRBY": {
166
+ "contents": [
167
+ {
168
+ "value": "```redis\nHINCRBY key field increment\n```\n**HINCRBY** increments the integer value of a hash field. Creates the field with value 0 if it doesn't exist.\n\n```redis\nHINCRBY user:1 login_count 1\n```\nTime complexity: **O(1)**"
169
+ }
170
+ ]
171
+ },
172
+ "HLEN": {
173
+ "contents": [
174
+ {
175
+ "value": "```redis\nHLEN key\n```\n**HLEN** returns the number of fields in a hash.\n\n```redis\nHLEN user:1 # => 3\n```\nTime complexity: **O(1)**"
176
+ }
177
+ ]
178
+ },
179
+ "HRANDFIELD": {
180
+ "contents": [
181
+ {
182
+ "value": "```redis\nHRANDFIELD key [count [WITHVALUES]]\n```\n**HRANDFIELD** returns random field(s) from a hash (Redis 6.2+). Negative count allows duplicates.\n\n```redis\nHRANDFIELD user:1 2 WITHVALUES\n```\nTime complexity: **O(N)** where N is count"
183
+ }
184
+ ]
185
+ },
186
+ "HSCAN": {
187
+ "contents": [
188
+ {
189
+ "value": "```redis\nHSCAN key cursor [MATCH pattern] [COUNT count]\n```\n**HSCAN** incrementally iterates hash fields. Use instead of `HGETALL` for large hashes.\n\n```redis\nHSCAN user:1 0 MATCH name* COUNT 10\n```\nTime complexity: **O(1)** per call, **O(N)** for full iteration"
190
+ }
191
+ ]
192
+ },
193
+ "LPUSH": {
194
+ "contents": [
195
+ {
196
+ "value": "```redis\nLPUSH key element [element ...]\n```\n**LPUSH** inserts elements at the head (left) of a list. Creates the list if it doesn't exist. Elements are inserted left to right, so the last specified is the first in the list.\n\n```redis\nLPUSH mylist \"world\" \"hello\"\nLRANGE mylist 0 -1 # => \"hello\" \"world\"\n```\nTime complexity: **O(N)** where N is number of elements"
197
+ }
198
+ ]
199
+ },
200
+ "RPUSH": {
201
+ "contents": [
202
+ {
203
+ "value": "```redis\nRPUSH key element [element ...]\n```\n**RPUSH** inserts elements at the tail (right) of a list.\n\n```redis\nRPUSH mylist \"hello\" \"world\"\nLRANGE mylist 0 -1 # => \"hello\" \"world\"\n```\nTime complexity: **O(N)**"
204
+ }
205
+ ]
206
+ },
207
+ "LPOP": {
208
+ "contents": [
209
+ {
210
+ "value": "```redis\nLPOP key [count]\n```\n**LPOP** removes and returns the first element(s) from a list. With `count`, returns up to that many elements (Redis 6.2+).\n\n```redis\nLPOP mylist # => \"hello\"\nLPOP mylist 3 # => multiple elements\n```\nTime complexity: **O(N)** where N is count"
211
+ }
212
+ ]
213
+ },
214
+ "RPOP": {
215
+ "contents": [
216
+ {
217
+ "value": "```redis\nRPOP key [count]\n```\n**RPOP** removes and returns the last element(s) from a list.\n\n```redis\nRPOP mylist # => \"world\"\n```\nTime complexity: **O(N)**"
218
+ }
219
+ ]
220
+ },
221
+ "LRANGE": {
222
+ "contents": [
223
+ {
224
+ "value": "```redis\nLRANGE key start stop\n```\n**LRANGE** returns elements from a list in the specified range. 0 is the first, -1 is the last.\n\n```redis\nLRANGE mylist 0 -1 # All elements\nLRANGE mylist 0 9 # First 10\n```\nTime complexity: **O(S+N)** where S is start offset and N is range length"
225
+ }
226
+ ]
227
+ },
228
+ "LLEN": {
229
+ "contents": [
230
+ {
231
+ "value": "```redis\nLLEN key\n```\n**LLEN** returns the length of a list. Returns 0 if key doesn't exist.\n\n```redis\nLLEN mylist # => 5\n```\nTime complexity: **O(1)**"
232
+ }
233
+ ]
234
+ },
235
+ "LINDEX": {
236
+ "contents": [
237
+ {
238
+ "value": "```redis\nLINDEX key index\n```\n**LINDEX** returns the element at `index` in a list. Negative indices count from the tail.\n\n```redis\nLINDEX mylist 0 # First element\nLINDEX mylist -1 # Last element\n```\nTime complexity: **O(N)** where N is the number of elements to traverse"
239
+ }
240
+ ]
241
+ },
242
+ "LINSERT": {
243
+ "contents": [
244
+ {
245
+ "value": "```redis\nLINSERT key BEFORE|AFTER pivot element\n```\n**LINSERT** inserts an element before or after the pivot value.\n\n```redis\nLINSERT mylist BEFORE \"World\" \"There\"\n```\nTime complexity: **O(N)** where N is number of elements to traverse"
246
+ }
247
+ ]
248
+ },
249
+ "BLPOP": {
250
+ "contents": [
251
+ {
252
+ "value": "```redis\nBLPOP key [key ...] timeout\n```\n**BLPOP** is the blocking version of LPOP. Blocks until an element is available or timeout is reached. Timeout of 0 blocks indefinitely.\n\n```redis\nBLPOP queue:tasks 30\nBLPOP q1 q2 q3 0 # Check multiple queues\n```\nUsed in **message queue** patterns.\nTime complexity: **O(N)** where N is number of keys"
253
+ }
254
+ ]
255
+ },
256
+ "BRPOP": {
257
+ "contents": [
258
+ {
259
+ "value": "```redis\nBRPOP key [key ...] timeout\n```\n**BRPOP** is the blocking version of RPOP. Blocks until an element is available.\n\n```redis\nBRPOP queue:tasks 30\n```\nTime complexity: **O(N)**"
260
+ }
261
+ ]
262
+ },
263
+ "LMOVE": {
264
+ "contents": [
265
+ {
266
+ "value": "```redis\nLMOVE source destination LEFT|RIGHT LEFT|RIGHT\n```\n**LMOVE** atomically pops from one end of source and pushes to one end of destination (Redis 6.2+). Replaces RPOPLPUSH.\n\n```redis\nLMOVE src dst LEFT RIGHT # Move head of src to tail of dst\n```\nTime complexity: **O(1)**"
267
+ }
268
+ ]
269
+ },
270
+ "LPOS": {
271
+ "contents": [
272
+ {
273
+ "value": "```redis\nLPOS key element [RANK rank] [COUNT count] [MAXLEN maxlen]\n```\n**LPOS** returns the position of an element in a list (Redis 6.0.6+).\n\n```redis\nLPOS mylist \"hello\" # => 0\nLPOS mylist \"hello\" RANK 2 # Second occurrence\nLPOS mylist \"hello\" COUNT 0 # All positions\n```\nTime complexity: **O(N)**"
274
+ }
275
+ ]
276
+ },
277
+ "SADD": {
278
+ "contents": [
279
+ {
280
+ "value": "```redis\nSADD key member [member ...]\n```\n**SADD** adds members to a set. Ignores members that already exist. Returns the number of new members added.\n\n```redis\nSADD tags \"redis\" \"database\" \"nosql\"\nSMEMBERS tags # => \"redis\" \"database\" \"nosql\"\n```\nTime complexity: **O(N)** where N is number of members"
281
+ }
282
+ ]
283
+ },
284
+ "SREM": {
285
+ "contents": [
286
+ {
287
+ "value": "```redis\nSREM key member [member ...]\n```\n**SREM** removes members from a set. Returns the number of members removed.\n\n```redis\nSREM tags \"nosql\"\n```\nTime complexity: **O(N)**"
288
+ }
289
+ ]
290
+ },
291
+ "SMEMBERS": {
292
+ "contents": [
293
+ {
294
+ "value": "```redis\nSMEMBERS key\n```\n**SMEMBERS** returns all members of a set. For large sets, use `SSCAN`.\n\n```redis\nSMEMBERS tags # => \"redis\" \"database\"\n```\nTime complexity: **O(N)**"
295
+ }
296
+ ]
297
+ },
298
+ "SISMEMBER": {
299
+ "contents": [
300
+ {
301
+ "value": "```redis\nSISMEMBER key member\n```\n**SISMEMBER** checks if `member` is in the set. Returns 1 or 0.\n\n```redis\nSISMEMBER tags \"redis\" # => 1\n```\nTime complexity: **O(1)**"
302
+ }
303
+ ]
304
+ },
305
+ "SCARD": {
306
+ "contents": [
307
+ {
308
+ "value": "```redis\nSCARD key\n```\n**SCARD** returns the number of elements in a set (cardinality).\n\n```redis\nSCARD tags # => 3\n```\nTime complexity: **O(1)**"
309
+ }
310
+ ]
311
+ },
312
+ "SUNION": {
313
+ "contents": [
314
+ {
315
+ "value": "```redis\nSUNION key [key ...]\n```\n**SUNION** returns the union of multiple sets.\n\n```redis\nSUNION set1 set2 # Members in either set\n```\nTime complexity: **O(N)** where N is total elements across all sets"
316
+ }
317
+ ]
318
+ },
319
+ "SINTER": {
320
+ "contents": [
321
+ {
322
+ "value": "```redis\nSINTER key [key ...]\n```\n**SINTER** returns the intersection of multiple sets.\n\n```redis\nSINTER set1 set2 # Members in both sets\n```\nTime complexity: **O(N*M)** worst case"
323
+ }
324
+ ]
325
+ },
326
+ "SDIFF": {
327
+ "contents": [
328
+ {
329
+ "value": "```redis\nSDIFF key [key ...]\n```\n**SDIFF** returns members in the first set but not in subsequent sets.\n\n```redis\nSDIFF set1 set2 # Members only in set1\n```\nTime complexity: **O(N)**"
330
+ }
331
+ ]
332
+ },
333
+ "SPOP": {
334
+ "contents": [
335
+ {
336
+ "value": "```redis\nSPOP key [count]\n```\n**SPOP** removes and returns random member(s) from a set.\n\n```redis\nSPOP myset # Random member\nSPOP myset 3 # 3 random members\n```\nTime complexity: **O(N)** where N is count"
337
+ }
338
+ ]
339
+ },
340
+ "SMOVE": {
341
+ "contents": [
342
+ {
343
+ "value": "```redis\nSMOVE source destination member\n```\n**SMOVE** atomically moves a member from one set to another.\n\n```redis\nSMOVE active archived \"item1\"\n```\nTime complexity: **O(1)**"
344
+ }
345
+ ]
346
+ },
347
+ "SINTERCARD": {
348
+ "contents": [
349
+ {
350
+ "value": "```redis\nSINTERCARD numkeys key [key ...] [LIMIT limit]\n```\n**SINTERCARD** returns the cardinality of the intersection without computing the full result (Redis 7.0+). Use `LIMIT` to stop early.\n\n```redis\nSINTERCARD 2 set1 set2 LIMIT 100\n```\nTime complexity: **O(N*M)** worst case"
351
+ }
352
+ ]
353
+ },
354
+ "ZADD": {
355
+ "contents": [
356
+ {
357
+ "value": "```redis\nZADD key [NX|XX] [GT|LT] [CH] score member [score member ...]\n```\n**ZADD** adds members with scores to a sorted set. Options:\n- `NX` — only add new elements\n- `XX` — only update existing elements\n- `GT` — only update if new score > current\n- `LT` — only update if new score < current\n- `CH` — return number of changed elements\n\n```redis\nZADD leaderboard 100 \"alice\" 200 \"bob\"\nZADD leaderboard GT CH 250 \"alice\" # Update if higher\n```\nTime complexity: **O(log(N))** per element"
358
+ }
359
+ ]
360
+ },
361
+ "ZRANGE": {
362
+ "contents": [
363
+ {
364
+ "value": "```redis\nZRANGE key min max [BYSCORE|BYLEX] [REV] [LIMIT offset count] [WITHSCORES]\n```\n**ZRANGE** returns members in a sorted set. Since Redis 6.2, replaces ZRANGEBYSCORE, ZRANGEBYLEX, ZREVRANGE.\n\n```redis\nZRANGE lb 0 9 WITHSCORES # Top 10 by rank\nZRANGE lb 100 200 BYSCORE LIMIT 0 10 # By score range\nZRANGE lb 0 9 REV WITHSCORES # Reverse order\n```\nTime complexity: **O(log(N)+M)** where M is the result set size"
365
+ }
366
+ ]
367
+ },
368
+ "ZSCORE": {
369
+ "contents": [
370
+ {
371
+ "value": "```redis\nZSCORE key member\n```\n**ZSCORE** returns the score of a member. Returns `nil` if member or key doesn't exist.\n\n```redis\nZSCORE leaderboard \"alice\" # => \"100\"\n```\nTime complexity: **O(1)**"
372
+ }
373
+ ]
374
+ },
375
+ "ZRANK": {
376
+ "contents": [
377
+ {
378
+ "value": "```redis\nZRANK key member [WITHSCORE]\n```\n**ZRANK** returns the rank (0-based, ascending by score) of a member. Returns `nil` if not found.\n\n```redis\nZRANK leaderboard \"alice\" # => 0 (lowest score)\nZRANK leaderboard \"alice\" WITHSCORE # (Redis 7.2+)\n```\nTime complexity: **O(log(N))**"
379
+ }
380
+ ]
381
+ },
382
+ "ZINCRBY": {
383
+ "contents": [
384
+ {
385
+ "value": "```redis\nZINCRBY key increment member\n```\n**ZINCRBY** increments the score of a member. Creates the member with score if it doesn't exist.\n\n```redis\nZINCRBY leaderboard 10 \"alice\" # => new score\n```\nTime complexity: **O(log(N))**"
386
+ }
387
+ ]
388
+ },
389
+ "ZCARD": {
390
+ "contents": [
391
+ {
392
+ "value": "```redis\nZCARD key\n```\n**ZCARD** returns the number of members in a sorted set.\n\n```redis\nZCARD leaderboard # => 5\n```\nTime complexity: **O(1)**"
393
+ }
394
+ ]
395
+ },
396
+ "ZCOUNT": {
397
+ "contents": [
398
+ {
399
+ "value": "```redis\nZCOUNT key min max\n```\n**ZCOUNT** counts members with scores in the given range. Use `-inf` and `+inf` for unbounded.\n\n```redis\nZCOUNT leaderboard 100 200\nZCOUNT leaderboard -inf +inf # All\nZCOUNT leaderboard \"(100\" 200 # Exclusive min\n```\nTime complexity: **O(log(N))**"
400
+ }
401
+ ]
402
+ },
403
+ "ZPOPMIN": {
404
+ "contents": [
405
+ {
406
+ "value": "```redis\nZPOPMIN key [count]\n```\n**ZPOPMIN** removes and returns member(s) with the lowest scores.\n\n```redis\nZPOPMIN leaderboard 3\n```\nUseful for **priority queues**.\nTime complexity: **O(log(N)*M)** where M is count"
407
+ }
408
+ ]
409
+ },
410
+ "ZPOPMAX": {
411
+ "contents": [
412
+ {
413
+ "value": "```redis\nZPOPMAX key [count]\n```\n**ZPOPMAX** removes and returns member(s) with the highest scores.\n\n```redis\nZPOPMAX leaderboard 3\n```\nTime complexity: **O(log(N)*M)**"
414
+ }
415
+ ]
416
+ },
417
+ "ZUNIONSTORE": {
418
+ "contents": [
419
+ {
420
+ "value": "```redis\nZUNIONSTORE dest numkeys key [key ...] [WEIGHTS w1 w2 ...] [AGGREGATE SUM|MIN|MAX]\n```\n**ZUNIONSTORE** stores the union of sorted sets with optional score weighting.\n\n```redis\nZUNIONSTORE combined 2 zset1 zset2 WEIGHTS 2 1 AGGREGATE MAX\n```\nTime complexity: **O(N*log(N))** with N being the sum of sizes"
421
+ }
422
+ ]
423
+ },
424
+ "ZINTERSTORE": {
425
+ "contents": [
426
+ {
427
+ "value": "```redis\nZINTERSTORE dest numkeys key [key ...] [WEIGHTS w1 w2 ...] [AGGREGATE SUM|MIN|MAX]\n```\n**ZINTERSTORE** stores the intersection of sorted sets.\n\n```redis\nZINTERSTORE common 2 zset1 zset2\n```\nTime complexity: **O(N*K*log(N))** where K is number of keys"
428
+ }
429
+ ]
430
+ },
431
+ "DEL": {
432
+ "contents": [
433
+ {
434
+ "value": "```redis\nDEL key [key ...]\n```\n**DEL** removes keys synchronously. Returns the number of keys removed.\n\n```redis\nDEL key1 key2 key3 # => 3\n```\n**Note**: For non-blocking deletion of large keys, use `UNLINK`.\nTime complexity: **O(N)** where N is number of keys"
435
+ }
436
+ ]
437
+ },
438
+ "UNLINK": {
439
+ "contents": [
440
+ {
441
+ "value": "```redis\nUNLINK key [key ...]\n```\n**UNLINK** removes keys asynchronously (non-blocking). The actual memory reclamation happens in a background thread.\n\n```redis\nUNLINK bigkey1 bigkey2\n```\n**Preferred over DEL** for large values (big lists, sets, hashes).\nTime complexity: **O(1)** for each key, **O(N)** for reclamation in background"
442
+ }
443
+ ]
444
+ },
445
+ "EXISTS": {
446
+ "contents": [
447
+ {
448
+ "value": "```redis\nEXISTS key [key ...]\n```\n**EXISTS** checks if key(s) exist. Returns the count of existing keys.\n\n```redis\nEXISTS key1 # => 1\nEXISTS key1 key2 key3 # => 2 (two exist)\n```\nTime complexity: **O(N)** where N is number of keys"
449
+ }
450
+ ]
451
+ },
452
+ "TYPE": {
453
+ "contents": [
454
+ {
455
+ "value": "```redis\nTYPE key\n```\n**TYPE** returns the data type of the value at `key`: string, list, set, zset, hash, stream.\n\n```redis\nSET mykey \"hello\"\nTYPE mykey # => string\nLPUSH mylist \"a\"\nTYPE mylist # => list\n```\nTime complexity: **O(1)**"
456
+ }
457
+ ]
458
+ },
459
+ "EXPIRE": {
460
+ "contents": [
461
+ {
462
+ "value": "```redis\nEXPIRE key seconds [NX|XX|GT|LT]\n```\n**EXPIRE** sets a timeout on a key in seconds. Options (Redis 7.0+):\n- `NX` — set expiry only if key has no expiry\n- `XX` — set expiry only if key has an existing expiry\n- `GT` — set only if new expiry > current\n- `LT` — set only if new expiry < current\n\n```redis\nSET mykey \"hello\"\nEXPIRE mykey 300\nTTL mykey # => 300\n```\nTime complexity: **O(1)**"
463
+ }
464
+ ]
465
+ },
466
+ "TTL": {
467
+ "contents": [
468
+ {
469
+ "value": "```redis\nTTL key\n```\n**TTL** returns remaining time to live in seconds. Returns -2 if key doesn't exist, -1 if key has no expiry.\n\n```redis\nSET mykey \"hello\" EX 60\nTTL mykey # => 60\nTTL nonexistent # => -2\nTTL persistent_key # => -1\n```\nTime complexity: **O(1)**"
470
+ }
471
+ ]
472
+ },
473
+ "PTTL": {
474
+ "contents": [
475
+ {
476
+ "value": "```redis\nPTTL key\n```\n**PTTL** returns remaining TTL in **milliseconds**. Returns -2 if key doesn't exist, -1 if no expiry.\n\n```redis\nPTTL mykey # => 59500\n```\nTime complexity: **O(1)**"
477
+ }
478
+ ]
479
+ },
480
+ "PERSIST": {
481
+ "contents": [
482
+ {
483
+ "value": "```redis\nPERSIST key\n```\n**PERSIST** removes the expiration from a key, making it persistent.\n\n```redis\nSET mykey \"hello\" EX 60\nPERSIST mykey\nTTL mykey # => -1\n```\nTime complexity: **O(1)**"
484
+ }
485
+ ]
486
+ },
487
+ "KEYS": {
488
+ "contents": [
489
+ {
490
+ "value": "```redis\nKEYS pattern\n```\n**KEYS** finds all keys matching a glob pattern.\n\n⚠️ **Warning**: `KEYS *` blocks the server on large databases. Use `SCAN` in production.\n\n```redis\nKEYS * # All keys\nKEYS user:* # Keys starting with user:\nKEYS h?llo # hello, hallo, hxllo...\n```\nTime complexity: **O(N)**"
491
+ }
492
+ ]
493
+ },
494
+ "SCAN": {
495
+ "contents": [
496
+ {
497
+ "value": "```redis\nSCAN cursor [MATCH pattern] [COUNT hint] [TYPE type]\n```\n**SCAN** incrementally iterates the key space. Non-blocking alternative to `KEYS`. Returns a cursor and a batch of keys.\n\n```redis\nSCAN 0 MATCH user:* COUNT 100\nSCAN 0 TYPE string # Only string keys\n```\nIterate until cursor returns 0.\nTime complexity: **O(1)** per call, **O(N)** for full iteration"
498
+ }
499
+ ]
500
+ },
501
+ "RENAME": {
502
+ "contents": [
503
+ {
504
+ "value": "```redis\nRENAME key newkey\n```\n**RENAME** renames a key. Overwrites `newkey` if it already exists.\n\n```redis\nRENAME old_name new_name\n```\nTime complexity: **O(1)**"
505
+ }
506
+ ]
507
+ },
508
+ "DUMP": {
509
+ "contents": [
510
+ {
511
+ "value": "```redis\nDUMP key\n```\n**DUMP** serializes the value at `key` in a Redis-specific format. Use with `RESTORE` for key migration.\n\n```redis\nDUMP mykey\n# Returns binary encoded value\n```\nTime complexity: **O(1)** to access, **O(N*M)** to serialize where M is serialized size"
512
+ }
513
+ ]
514
+ },
515
+ "RESTORE": {
516
+ "contents": [
517
+ {
518
+ "value": "```redis\nRESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency]\n```\n**RESTORE** deserializes a value from `DUMP`. Use `REPLACE` to overwrite existing key.\n\n```redis\nDUMP mykey # on source\nRESTORE mykey 0 \"\\x00...\" REPLACE # on destination\n```\nTime complexity: **O(1)** to access, **O(N*M)** to reconstruct"
519
+ }
520
+ ]
521
+ },
522
+ "COPY": {
523
+ "contents": [
524
+ {
525
+ "value": "```redis\nCOPY source destination [DB db] [REPLACE]\n```\n**COPY** copies a key's value to another key (Redis 6.2+). Use `REPLACE` to overwrite destination.\n\n```redis\nCOPY src dst REPLACE\nCOPY src dst DB 1 # Copy to different database\n```\nTime complexity: **O(N)** where N is the size of the value"
526
+ }
527
+ ]
528
+ },
529
+ "SORT": {
530
+ "contents": [
531
+ {
532
+ "value": "```redis\nSORT key [BY pattern] [LIMIT offset count] [GET pattern ...] [ASC|DESC] [ALPHA] [STORE dest]\n```\n**SORT** sorts elements in a list, set, or sorted set. Can dereference external keys.\n\n```redis\nSORT mylist ALPHA DESC LIMIT 0 10\nSORT mylist BY weight_* GET # GET name_* STORE sorted\n```\nTime complexity: **O(N+M*log(M))** where N is list size, M is number of returned elements"
533
+ }
534
+ ]
535
+ },
536
+ "OBJECT ENCODING": {
537
+ "contents": [
538
+ {
539
+ "value": "```redis\nOBJECT ENCODING key\n```\n**OBJECT ENCODING** returns the internal encoding used by Redis for the value.\n\n```redis\nOBJECT ENCODING mykey\n# Returns: embstr, int, raw, ziplist, listpack, quicklist,\n# hashtable, skiplist, intset, etc.\n```\nUseful for understanding memory optimization.\nTime complexity: **O(1)**"
540
+ }
541
+ ]
542
+ },
543
+ "RANDOMKEY": {
544
+ "contents": [
545
+ {
546
+ "value": "```redis\nRANDOMKEY\n```\n**RANDOMKEY** returns a random key from the current database. Returns `nil` if the database is empty.\n\n```redis\nRANDOMKEY # => \"user:42\"\n```\nTime complexity: **O(1)**"
547
+ }
548
+ ]
549
+ },
550
+ "PFADD": {
551
+ "contents": [
552
+ {
553
+ "value": "```redis\nPFADD key element [element ...]\n```\n**PFADD** adds elements to a HyperLogLog. Uses ~12KB of memory regardless of cardinality.\n\n```redis\nPFADD unique_visitors \"user1\" \"user2\" \"user3\"\nPFCOUNT unique_visitors # Approximate unique count\n```\nIdeal for **counting unique items** (visitors, IPs, etc.) with 0.81% standard error.\nTime complexity: **O(N)**"
554
+ }
555
+ ]
556
+ },
557
+ "PFCOUNT": {
558
+ "contents": [
559
+ {
560
+ "value": "```redis\nPFCOUNT key [key ...]\n```\n**PFCOUNT** returns the approximate cardinality of a HyperLogLog. With multiple keys, returns the cardinality of the union.\n\n```redis\nPFCOUNT visitors # => ~1000000\nPFCOUNT day1 day2 day3 # Union of all three\n```\nTime complexity: **O(1)** for single key, **O(N)** for union"
561
+ }
562
+ ]
563
+ },
564
+ "PFMERGE": {
565
+ "contents": [
566
+ {
567
+ "value": "```redis\nPFMERGE destkey sourcekey [sourcekey ...]\n```\n**PFMERGE** merges multiple HyperLogLogs into one.\n\n```redis\nPFMERGE weekly_visitors mon tue wed thu fri\nPFCOUNT weekly_visitors\n```\nTime complexity: **O(N)** where N is number of source keys"
568
+ }
569
+ ]
570
+ },
571
+ "SETBIT": {
572
+ "contents": [
573
+ {
574
+ "value": "```redis\nSETBIT key offset value\n```\n**SETBIT** sets or clears the bit at `offset`. Returns the original bit value.\n\n```redis\nSETBIT active_users 1000 1 # User 1000 is active\nGETBIT active_users 1000 # => 1\n```\nUseful for **flags, presence tracking, feature flags**.\nTime complexity: **O(1)**"
575
+ }
576
+ ]
577
+ },
578
+ "GETBIT": {
579
+ "contents": [
580
+ {
581
+ "value": "```redis\nGETBIT key offset\n```\n**GETBIT** returns the bit value at `offset`.\n\n```redis\nGETBIT active_users 1000 # => 1 (active)\nGETBIT active_users 9999 # => 0 (not set)\n```\nTime complexity: **O(1)**"
582
+ }
583
+ ]
584
+ },
585
+ "BITCOUNT": {
586
+ "contents": [
587
+ {
588
+ "value": "```redis\nBITCOUNT key [start end [BYTE|BIT]]\n```\n**BITCOUNT** counts the number of set bits (1s). Optional range specifies byte or bit range.\n\n```redis\nBITCOUNT active_users # Total active users\nBITCOUNT active_users 0 0 # First byte\n```\nTime complexity: **O(N)**"
589
+ }
590
+ ]
591
+ },
592
+ "BITOP": {
593
+ "contents": [
594
+ {
595
+ "value": "```redis\nBITOP operation destkey key [key ...]\n```\n**BITOP** performs bitwise operations (AND, OR, XOR, NOT) between strings.\n\n```redis\nBITOP AND both_active day1_active day2_active\nBITOP OR any_active day1_active day2_active\n```\nUseful for **combining bitmap flags**.\nTime complexity: **O(N)**"
596
+ }
597
+ ]
598
+ },
599
+ "XADD": {
600
+ "contents": [
601
+ {
602
+ "value": "```redis\nXADD key [NOMKSTREAM] [MAXLEN|MINID [=|~] threshold] *|id field value [field value ...]\n```\n**XADD** appends an entry to a stream. Use `*` for auto-generated ID.\n\n```redis\nXADD mystream * sensor_id 1234 temperature 19.8\nXADD mystream MAXLEN ~ 1000 * data value # Cap at ~1000 entries\n```\nStreams are the Redis data structure for **log/event processing**.\nTime complexity: **O(1)** when ID is auto-generated"
603
+ }
604
+ ]
605
+ },
606
+ "XREAD": {
607
+ "contents": [
608
+ {
609
+ "value": "```redis\nXREAD [COUNT count] [BLOCK ms] STREAMS key [key ...] id [id ...]\n```\n**XREAD** reads entries from one or more streams. Use `$` to read only new entries.\n\n```redis\nXREAD COUNT 10 STREAMS mystream 0 # From beginning\nXREAD BLOCK 5000 COUNT 10 STREAMS mystream $ # Block for new entries\n```\nTime complexity: **O(N)** where N is count"
610
+ }
611
+ ]
612
+ },
613
+ "XREADGROUP": {
614
+ "contents": [
615
+ {
616
+ "value": "```redis\nXREADGROUP GROUP group consumer [COUNT count] [BLOCK ms] [NOACK] STREAMS key [key ...] id [id ...]\n```\n**XREADGROUP** reads from a stream as a consumer group member. Use `>` to read only undelivered messages.\n\n```redis\nXREADGROUP GROUP mygroup consumer1 COUNT 10 BLOCK 5000 STREAMS mystream >\n```\nConsumer groups enable **reliable message processing** with acknowledgments.\nTime complexity: **O(M)** where M is count"
617
+ }
618
+ ]
619
+ },
620
+ "XACK": {
621
+ "contents": [
622
+ {
623
+ "value": "```redis\nXACK key group id [id ...]\n```\n**XACK** acknowledges messages, removing them from the consumer's pending entries list (PEL).\n\n```redis\nXACK mystream mygroup 1526569495631-0\n```\nTime complexity: **O(1)** per ID"
624
+ }
625
+ ]
626
+ },
627
+ "XGROUP CREATE": {
628
+ "contents": [
629
+ {
630
+ "value": "```redis\nXGROUP CREATE key group id|$ [MKSTREAM] [ENTRIESREAD entries-read]\n```\n**XGROUP CREATE** creates a consumer group.\n- Use `$` to consume only new messages\n- Use `0` to consume from the beginning\n- `MKSTREAM` creates the stream if it doesn't exist\n\n```redis\nXGROUP CREATE events processors $ MKSTREAM\nXGROUP CREATE events reprocessors 0\n```\nTime complexity: **O(1)**"
631
+ }
632
+ ]
633
+ },
634
+ "XPENDING": {
635
+ "contents": [
636
+ {
637
+ "value": "```redis\nXPENDING key group [[IDLE min-idle-time] start end count [consumer]]\n```\n**XPENDING** inspects the pending entries list — messages delivered but not yet acknowledged.\n\n```redis\nXPENDING mystream mygroup # Summary\nXPENDING mystream mygroup - + 10 # First 10 pending\nXPENDING mystream mygroup IDLE 60000 - + 10 # Idle > 60s\n```\nTime complexity: **O(N)**"
638
+ }
639
+ ]
640
+ },
641
+ "XCLAIM": {
642
+ "contents": [
643
+ {
644
+ "value": "```redis\nXCLAIM key group consumer min-idle-time id [id ...] [IDLE ms] [TIME ms] [RETRYCOUNT count] [FORCE] [JUSTID]\n```\n**XCLAIM** transfers ownership of pending messages to another consumer. Used for **message recovery** when a consumer crashes.\n\n```redis\nXCLAIM mystream mygroup consumer2 3600000 1526569495631-0\n```\nTime complexity: **O(log(N))** per message"
645
+ }
646
+ ]
647
+ },
648
+ "XAUTOCLAIM": {
649
+ "contents": [
650
+ {
651
+ "value": "```redis\nXAUTOCLAIM key group consumer min-idle-time start [COUNT count] [JUSTID]\n```\n**XAUTOCLAIM** automatically transfers idle pending messages (Redis 6.2+). Simpler than XPENDING + XCLAIM.\n\n```redis\nXAUTOCLAIM mystream mygroup consumer2 3600000 0-0 COUNT 25\n```\nTime complexity: **O(1)** per claimed message"
652
+ }
653
+ ]
654
+ },
655
+ "XINFO STREAM": {
656
+ "contents": [
657
+ {
658
+ "value": "```redis\nXINFO STREAM key [FULL [COUNT count]]\n```\n**XINFO STREAM** returns information about a stream including length, first/last entry, consumer groups.\n\n```redis\nXINFO STREAM mystream\nXINFO STREAM mystream FULL # Detailed view\n```\nTime complexity: **O(1)** for default, **O(N)** for FULL"
659
+ }
660
+ ]
661
+ },
662
+ "XLEN": {
663
+ "contents": [
664
+ {
665
+ "value": "```redis\nXLEN key\n```\n**XLEN** returns the number of entries in a stream.\n\n```redis\nXLEN mystream # => 150\n```\nTime complexity: **O(1)**"
666
+ }
667
+ ]
668
+ },
669
+ "XTRIM": {
670
+ "contents": [
671
+ {
672
+ "value": "```redis\nXTRIM key MAXLEN|MINID [=|~] threshold\n```\n**XTRIM** trims a stream to a maximum length or minimum ID. Use `~` for approximate trimming (faster).\n\n```redis\nXTRIM mystream MAXLEN ~ 1000\nXTRIM mystream MINID 1526569495631-0\n```\nTime complexity: **O(N)** where N is the number of evicted entries"
673
+ }
674
+ ]
675
+ },
676
+ "SUBSCRIBE": {
677
+ "contents": [
678
+ {
679
+ "value": "```redis\nSUBSCRIBE channel [channel ...]\n```\n**SUBSCRIBE** listens for messages on one or more channels. The connection enters subscriber mode — only (P|S)SUBSCRIBE, (P|S)UNSUBSCRIBE, PING, RESET, QUIT are allowed.\n\n```redis\nSUBSCRIBE notifications alerts\n```\nMessages are fire-and-forget — no persistence, no replay.\nTime complexity: **O(N)** where N is number of channels"
680
+ }
681
+ ]
682
+ },
683
+ "PUBLISH": {
684
+ "contents": [
685
+ {
686
+ "value": "```redis\nPUBLISH channel message\n```\n**PUBLISH** sends a message to all subscribers of a channel. Returns the number of clients that received it.\n\n```redis\nPUBLISH notifications \"New order received\"\n```\nTime complexity: **O(N+M)** where N is channel subscribers and M is pattern subscribers"
687
+ }
688
+ ]
689
+ },
690
+ "PSUBSCRIBE": {
691
+ "contents": [
692
+ {
693
+ "value": "```redis\nPSUBSCRIBE pattern [pattern ...]\n```\n**PSUBSCRIBE** subscribes to channels matching glob patterns.\n\n```redis\nPSUBSCRIBE news.* # news.sports, news.tech, etc.\nPSUBSCRIBE __keyevent@0__:* # Keyspace notifications\n```\nTime complexity: **O(N)** where N is number of patterns"
694
+ }
695
+ ]
696
+ },
697
+ "MULTI": {
698
+ "contents": [
699
+ {
700
+ "value": "```redis\nMULTI\n```\n**MULTI** marks the start of a transaction block. Subsequent commands are queued and executed atomically with `EXEC`.\n\n```redis\nMULTI\nSET key1 \"val1\"\nSET key2 \"val2\"\nINCR counter\nEXEC # => [OK, OK, 1]\n```\nTransactions are **atomic** — either all commands execute or none.\nTime complexity: **O(1)**"
701
+ }
702
+ ]
703
+ },
704
+ "EXEC": {
705
+ "contents": [
706
+ {
707
+ "value": "```redis\nEXEC\n```\n**EXEC** executes all queued commands in the transaction and restores the connection to normal. Returns an array of results.\n\nReturns `nil` if `WATCH` detected a modification (optimistic lock failure).\n\n```redis\nWATCH balance\nMULTI\nDECRBY balance 100\nINCRBY other_balance 100\nEXEC # nil if balance was modified\n```\nTime complexity: **O(N)** where N is number of queued commands"
708
+ }
709
+ ]
710
+ },
711
+ "WATCH": {
712
+ "contents": [
713
+ {
714
+ "value": "```redis\nWATCH key [key ...]\n```\n**WATCH** enables optimistic locking (check-and-set). If any watched key is modified before `EXEC`, the transaction is aborted.\n\n```redis\nWATCH balance\nval = GET balance\nMULTI\nSET balance (val - 100)\nEXEC # nil if another client changed balance\n```\nTime complexity: **O(1)** per key"
715
+ }
716
+ ]
717
+ },
718
+ "DISCARD": {
719
+ "contents": [
720
+ {
721
+ "value": "```redis\nDISCARD\n```\n**DISCARD** aborts the transaction, discarding all queued commands.\n\n```redis\nMULTI\nSET key1 \"val1\"\nDISCARD # Transaction cancelled\n```\nTime complexity: **O(N)** where N is number of queued commands"
722
+ }
723
+ ]
724
+ },
725
+ "EVAL": {
726
+ "contents": [
727
+ {
728
+ "value": "```redis\nEVAL script numkeys [key ...] [arg ...]\n```\n**EVAL** executes a Lua script server-side. Scripts are **atomic** — no other command runs during execution.\n\n```redis\nEVAL \"return redis.call('GET',KEYS[1])\" 1 mykey\nEVAL \"redis.call('SET',KEYS[1],ARGV[1]); return redis.call('GET',KEYS[1])\" 1 mykey myval\n```\nUse `redis.call()` for errors, `redis.pcall()` for protected calls.\nTime complexity: Depends on the script"
729
+ }
730
+ ]
731
+ },
732
+ "EVALSHA": {
733
+ "contents": [
734
+ {
735
+ "value": "```redis\nEVALSHA sha1 numkeys [key ...] [arg ...]\n```\n**EVALSHA** executes a cached Lua script by its SHA1 hash. Load scripts with `SCRIPT LOAD` first.\n\n```redis\nSCRIPT LOAD \"return redis.call('GET',KEYS[1])\" # => sha1\nEVALSHA sha1 1 mykey\n```\nMore efficient than EVAL for repeated scripts.\nTime complexity: Depends on the script"
736
+ }
737
+ ]
738
+ },
739
+ "FUNCTION LOAD": {
740
+ "contents": [
741
+ {
742
+ "value": "```redis\nFUNCTION LOAD [REPLACE] function-code\n```\n**FUNCTION LOAD** loads a function library (Redis 7.0+). Functions persist across restarts unlike EVAL scripts.\n\n```redis\nFUNCTION LOAD \"#!lua name=mylib\\nredis.register_function('myfunc', function(keys, args) return redis.call('GET', keys[1]) end)\"\nFCALL myfunc 1 mykey\n```\nTime complexity: **O(N)** where N is the function code length"
743
+ }
744
+ ]
745
+ },
746
+ "FCALL": {
747
+ "contents": [
748
+ {
749
+ "value": "```redis\nFCALL function numkeys [key ...] [arg ...]\n```\n**FCALL** calls a loaded Redis function (Redis 7.0+).\n\n```redis\nFCALL myfunc 1 mykey\n```\nTime complexity: Depends on the function"
750
+ }
751
+ ]
752
+ },
753
+ "GEOADD": {
754
+ "contents": [
755
+ {
756
+ "value": "```redis\nGEOADD key [NX|XX] [CH] longitude latitude member [longitude latitude member ...]\n```\n**GEOADD** adds geospatial items (longitude/latitude) to a sorted set.\n\n```redis\nGEOADD restaurants 13.361389 38.115556 \"Sicily Pizza\"\nGEOADD restaurants NX 2.349014 48.864716 \"Paris Cafe\"\n```\nInternally uses a sorted set with geohash scores.\nTime complexity: **O(log(N))** per item"
757
+ }
758
+ ]
759
+ },
760
+ "GEOSEARCH": {
761
+ "contents": [
762
+ {
763
+ "value": "```redis\nGEOSEARCH key FROMMEMBER member|FROMLONLAT lon lat BYRADIUS radius m|km|ft|mi|BYBOX width height m|km|ft|mi [ASC|DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH]\n```\n**GEOSEARCH** finds members within a radius or bounding box (Redis 6.2+).\n\n```redis\nGEOSEARCH places FROMLONLAT 13.361 38.115 BYRADIUS 100 km ASC COUNT 5 WITHDIST\nGEOSEARCH places FROMMEMBER \"home\" BYBOX 400 400 km ASC\n```\nTime complexity: **O(N+log(N))** where N is the number of nearby members"
764
+ }
765
+ ]
766
+ },
767
+ "GEODIST": {
768
+ "contents": [
769
+ {
770
+ "value": "```redis\nGEODIST key member1 member2 [M|KM|FT|MI]\n```\n**GEODIST** returns the distance between two geospatial members.\n\n```redis\nGEODIST places \"Rome\" \"Paris\" km # => \"1105.5914\"\n```\nTime complexity: **O(1)**"
771
+ }
772
+ ]
773
+ },
774
+ "INFO": {
775
+ "contents": [
776
+ {
777
+ "value": "```redis\nINFO [section [section ...]]\n```\n**INFO** returns server information and statistics. Sections: server, clients, memory, persistence, stats, replication, cpu, commandstats, latencystats, cluster, keyspace, modules, errorstats.\n\n```redis\nINFO # All sections\nINFO memory # Memory usage details\nINFO server # Server version, uptime, etc.\nINFO keyspace # Per-database key counts\n```\nTime complexity: **O(1)**"
778
+ }
779
+ ]
780
+ },
781
+ "CONFIG GET": {
782
+ "contents": [
783
+ {
784
+ "value": "```redis\nCONFIG GET parameter [parameter ...]\n```\n**CONFIG GET** reads configuration parameters. Supports glob patterns.\n\n```redis\nCONFIG GET maxmemory\nCONFIG GET *policy*\nCONFIG GET save\n```\nTime complexity: **O(N)** where N is number of parameters"
785
+ }
786
+ ]
787
+ },
788
+ "CONFIG SET": {
789
+ "contents": [
790
+ {
791
+ "value": "```redis\nCONFIG SET parameter value [parameter value ...]\n```\n**CONFIG SET** dynamically changes configuration without restart.\n\n```redis\nCONFIG SET maxmemory 256mb\nCONFIG SET maxmemory-policy allkeys-lru\nCONFIG SET save \"3600 1 300 100\"\n```\nTime complexity: **O(N)** for config parameters requiring list processing"
792
+ }
793
+ ]
794
+ },
795
+ "FLUSHDB": {
796
+ "contents": [
797
+ {
798
+ "value": "```redis\nFLUSHDB [ASYNC|SYNC]\n```\n**FLUSHDB** deletes all keys in the current database.\n\n⚠️ **Destructive operation** — use with caution in production.\n\n```redis\nFLUSHDB # Synchronous, blocks server\nFLUSHDB ASYNC # Non-blocking\n```\nTime complexity: **O(N)** where N is number of keys"
799
+ }
800
+ ]
801
+ },
802
+ "FLUSHALL": {
803
+ "contents": [
804
+ {
805
+ "value": "```redis\nFLUSHALL [ASYNC|SYNC]\n```\n**FLUSHALL** deletes all keys from **all databases**.\n\n⚠️ **Destructive operation** — deletes everything.\n\n```redis\nFLUSHALL ASYNC\n```\nTime complexity: **O(N)** where N is total keys across all databases"
806
+ }
807
+ ]
808
+ },
809
+ "BGSAVE": {
810
+ "contents": [
811
+ {
812
+ "value": "```redis\nBGSAVE [SCHEDULE]\n```\n**BGSAVE** triggers a background RDB snapshot. Returns error if another save is in progress (unless `SCHEDULE` is used).\n\n```redis\nBGSAVE\nBGSAVE SCHEDULE # Schedule if another save is running\n```\nTime complexity: **O(1)** to trigger"
813
+ }
814
+ ]
815
+ },
816
+ "DBSIZE": {
817
+ "contents": [
818
+ {
819
+ "value": "```redis\nDBSIZE\n```\n**DBSIZE** returns the number of keys in the currently selected database.\n\n```redis\nDBSIZE # => (integer) 42\n```\nTime complexity: **O(1)**"
820
+ }
821
+ ]
822
+ },
823
+ "SLOWLOG GET": {
824
+ "contents": [
825
+ {
826
+ "value": "```redis\nSLOWLOG GET [count]\n```\n**SLOWLOG GET** returns entries from the slow log — commands that exceeded the `slowlog-log-slower-than` threshold.\n\n```redis\nSLOWLOG GET 10\n```\nEach entry contains: ID, timestamp, execution time (μs), command + args, client info.\nTime complexity: **O(N)**"
827
+ }
828
+ ]
829
+ },
830
+ "CLIENT LIST": {
831
+ "contents": [
832
+ {
833
+ "value": "```redis\nCLIENT LIST [TYPE normal|master|replica|pubsub] [ID id ...]\n```\n**CLIENT LIST** returns info about connected clients: address, fd, age, idle time, flags, database, command.\n\n```redis\nCLIENT LIST\nCLIENT LIST TYPE normal\n```\nTime complexity: **O(N)** where N is number of clients"
834
+ }
835
+ ]
836
+ },
837
+ "MEMORY USAGE": {
838
+ "contents": [
839
+ {
840
+ "value": "```redis\nMEMORY USAGE key [SAMPLES count]\n```\n**MEMORY USAGE** estimates memory consumption of a key in bytes, including overhead.\n\n```redis\nMEMORY USAGE mykey # => (integer) 56\nMEMORY USAGE myhash SAMPLES 5 # More accurate for complex types\n```\nTime complexity: **O(1)** for simple keys, **O(N)** with SAMPLES for complex types"
841
+ }
842
+ ]
843
+ },
844
+ "MONITOR": {
845
+ "contents": [
846
+ {
847
+ "value": "```redis\nMONITOR\n```\n**MONITOR** streams every command processed by the server in real-time. Useful for debugging.\n\n```redis\nMONITOR\n# Output: 1339518083.107412 [0 127.0.0.1:60866] \"keys\" \"*\"\n```\n⚠️ **Performance impact** — reduces throughput by ~50%. Never use in production."
848
+ }
849
+ ]
850
+ },
851
+ "SELECT": {
852
+ "contents": [
853
+ {
854
+ "value": "```redis\nSELECT index\n```\n**SELECT** switches to a different database (0-15 by default).\n\n```redis\nSELECT 1 # Switch to database 1\nSET mykey \"hello\"\nSELECT 0 # Back to database 0\n```\nTime complexity: **O(1)**"
855
+ }
856
+ ]
857
+ },
858
+ "ACL SETUSER": {
859
+ "contents": [
860
+ {
861
+ "value": "```redis\nACL SETUSER username [rule [rule ...]]\n```\n**ACL SETUSER** creates or modifies a user's access control rules.\n\nRules:\n- `on`/`off` — enable/disable user\n- `>password` — add password\n- `~pattern` — allowed key patterns\n- `+command` — allow command\n- `-command` — deny command\n- `+@category` — allow command category\n- `allkeys` — allow all keys\n- `allcommands` — allow all commands\n\n```redis\nACL SETUSER readonly on >pass123 ~cached:* +get +mget +hgetall\nACL SETUSER admin on >adminpass allkeys allcommands\n```\nTime complexity: **O(N)** where N is number of rules"
862
+ }
863
+ ]
864
+ },
865
+ "AUTH": {
866
+ "contents": [
867
+ {
868
+ "value": "```redis\nAUTH [username] password\n```\n**AUTH** authenticates to the server. With ACL (Redis 6+), provide username and password.\n\n```redis\nAUTH mypassword # Default user\nAUTH myuser mypassword # ACL user\n```\nTime complexity: **O(N)** where N is the number of passwords configured"
869
+ }
870
+ ]
871
+ },
872
+ "CLUSTER INFO": {
873
+ "contents": [
874
+ {
875
+ "value": "```redis\nCLUSTER INFO\n```\n**CLUSTER INFO** returns cluster state: enabled, state (ok/fail), known nodes, size, slots assigned, messages sent/received.\n\n```redis\nCLUSTER INFO\n# cluster_enabled:1\n# cluster_state:ok\n# cluster_slots_assigned:16384\n# cluster_size:3\n```\nTime complexity: **O(1)**"
876
+ }
877
+ ]
878
+ },
879
+ "CLUSTER NODES": {
880
+ "contents": [
881
+ {
882
+ "value": "```redis\nCLUSTER NODES\n```\n**CLUSTER NODES** returns the cluster membership table. Each line describes a node: ID, address, flags, master, ping/pong times, epoch, link-state, slots.\n\n```redis\nCLUSTER NODES\n# 07c37df... 127.0.0.1:6379 myself,master - 0 0 1 connected 0-5460\n```\nTime complexity: **O(N)** where N is the number of nodes"
883
+ }
884
+ ]
885
+ },
886
+ "CLUSTER FAILOVER": {
887
+ "contents": [
888
+ {
889
+ "value": "```redis\nCLUSTER FAILOVER [FORCE|TAKEOVER]\n```\n**CLUSTER FAILOVER** initiates manual failover of a master. Run on the replica.\n\n- No option: safe failover with coordination\n- `FORCE`: force failover even if master is unreachable\n- `TAKEOVER`: force without cluster consensus\n\n```redis\nCLUSTER FAILOVER # Safe failover\n```\nTime complexity: **O(1)**"
890
+ }
891
+ ]
892
+ },
893
+ "REPLICAOF": {
894
+ "contents": [
895
+ {
896
+ "value": "```redis\nREPLICAOF host port\nREPLICAOF NO ONE\n```\n**REPLICAOF** makes the server a replica of another or promotes it to master.\n\n```redis\nREPLICAOF 192.168.1.1 6379 # Become replica\nREPLICAOF NO ONE # Promote to master\n```\nTime complexity: **O(1)**"
897
+ }
898
+ ]
899
+ },
900
+ "PING": {
901
+ "contents": [
902
+ {
903
+ "value": "```redis\nPING [message]\n```\n**PING** tests connectivity. Returns `PONG` or echoes the message.\n\n```redis\nPING # => PONG\nPING \"hello\" # => \"hello\"\n```\nCommonly used for health checks and keepalive.\nTime complexity: **O(1)**"
904
+ }
905
+ ]
906
+ },
907
+ "ACL CAT": {
908
+ "contents": [
909
+ {
910
+ "value": "## ACL CAT\n\n```redis\nACL CAT [category]\n```\n\nList all ACL categories or commands in a category.\n\n```redis\n> ACL CAT\n1) \"read\"\n2) \"write\"\n3) \"set\"\n...\n\n> ACL CAT read\n1) \"GET\"\n2) \"MGET\"\n...\n```"
911
+ }
912
+ ]
913
+ },
914
+ "ACL DELUSER": {
915
+ "contents": [
916
+ {
917
+ "value": "## ACL DELUSER\n\n```redis\nACL DELUSER username [username ...]\n```\n\nDelete ACL users. Cannot delete the `default` user.\n\n```redis\n> ACL DELUSER tempuser\nOK\n```"
918
+ }
919
+ ]
920
+ },
921
+ "ACL GENPASS": {
922
+ "contents": [
923
+ {
924
+ "value": "## ACL GENPASS\n\n```redis\nACL GENPASS [bits]\n```\n\nGenerate a secure password for ACL users.\n\n```redis\n> ACL GENPASS\n\"1a2b3c4d5e6f...\"\n\n> ACL GENPASS 128\n\"a1b2c3d4e5f6a7b8...\"\n```"
925
+ }
926
+ ]
927
+ },
928
+ "ACL GETUSER": {
929
+ "contents": [
930
+ {
931
+ "value": "## ACL GETUSER\n\n```redis\nACL GETUSER username\n```\n\nGet ACL rules for a specific user.\n\n```redis\n> ACL GETUSER default\n1) \"flags\"\n2) 1) \"on\"\n3) \"passwords\"\n...\n```"
932
+ }
933
+ ]
934
+ },
935
+ "CLIENT KILL": {
936
+ "contents": [
937
+ {
938
+ "value": "## CLIENT KILL\n\n```redis\nCLIENT KILL [ID id] [ADDR ip:port] [LADDR ip:port] [USER username]\n```\n\nClose client connections matching filters.\n\n```redis\n> CLIENT KILL ID 42\n(integer) 1\n\n> CLIENT KILL ADDR 192.168.1.100:52340\n(integer) 1\n```"
939
+ }
940
+ ]
941
+ },
942
+ "CLIENT SETNAME": {
943
+ "contents": [
944
+ {
945
+ "value": "## CLIENT SETNAME\n\n```redis\nCLIENT SETNAME connection-name\n```\n\nSet a name for the current connection (visible in CLIENT LIST).\n\n```redis\n> CLIENT SETNAME worker-1\nOK\n```"
946
+ }
947
+ ]
948
+ },
949
+ "CLUSTER ADDSLOTS": {
950
+ "contents": [
951
+ {
952
+ "value": "## CLUSTER ADDSLOTS\n\n```redis\nCLUSTER ADDSLOTS slot [slot ...]\n```\n\nAssign hash slots to the current node.\n\n```redis\n> CLUSTER ADDSLOTS 0 1 2 3 4 5\nOK\n```"
953
+ }
954
+ ]
955
+ },
956
+ "DEBUG OBJECT": {
957
+ "contents": [
958
+ {
959
+ "value": "## DEBUG OBJECT\n\n```redis\nDEBUG OBJECT key\n```\n\nGet debugging information about a key's internal encoding.\n\n```redis\n> DEBUG OBJECT mykey\nValue at:0x... refcount:1 encoding:embstr serializedlength:3 lru:... lru_seconds_idle:0\n```"
960
+ }
961
+ ]
962
+ },
963
+ "BITFIELD": {
964
+ "contents": [
965
+ {
966
+ "value": "## BITFIELD\n\n```redis\nBITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]\n```\n\nPerform arbitrary bitfield integer operations on strings.\n\n```redis\n# Set 8-bit unsigned counter at bit offset 0\n> BITFIELD mykey SET u8 0 200\n1) (integer) 0\n\n# Increment by 50 with saturation overflow\n> BITFIELD mykey OVERFLOW SAT INCRBY u8 0 50\n1) (integer) 250\n```"
967
+ }
968
+ ]
969
+ },
970
+ "BITPOS": {
971
+ "contents": [
972
+ {
973
+ "value": "## BITPOS\n\n```redis\nBITPOS key bit [start [end [BYTE|BIT]]]\n```\n\nFind first bit set to 0 or 1.\n\n```redis\n> SET mykey \"\\xff\\xf0\\x00\"\nOK\n> BITPOS mykey 0 -- first 0 bit\n(integer) 12\n> BITPOS mykey 1 -- first 1 bit\n(integer) 0\n```"
974
+ }
975
+ ]
976
+ },
977
+ "BLMOVE": {
978
+ "contents": [
979
+ {
980
+ "value": "## BLMOVE\n\n```redis\nBLMOVE source destination LEFT|RIGHT LEFT|RIGHT timeout\n```\n\nBlocking version of LMOVE. Pop from source list and push to destination.\n\n```redis\n> BLMOVE mylist newlist LEFT RIGHT 0\n\"element\"\n```"
981
+ }
982
+ ]
983
+ },
984
+ "OBJECT FREQ": {
985
+ "contents": [
986
+ {
987
+ "value": "## OBJECT FREQ\n\n```redis\nOBJECT FREQ key\n```\n\nReturn the access frequency for LFU eviction policy.\n\n```redis\n> OBJECT FREQ mykey\n(integer) 5\n```\n\nOnly useful with `maxmemory-policy` set to an LFU variant."
988
+ }
989
+ ]
990
+ },
991
+ "OBJECT IDLETIME": {
992
+ "contents": [
993
+ {
994
+ "value": "## OBJECT IDLETIME\n\n```redis\nOBJECT IDLETIME key\n```\n\nReturn seconds since the key was last accessed.\n\n```redis\n> OBJECT IDLETIME mykey\n(integer) 120\n```"
995
+ }
996
+ ]
997
+ },
998
+ "OBJECT REFCOUNT": {
999
+ "contents": [
1000
+ {
1001
+ "value": "## OBJECT REFCOUNT\n\n```redis\nOBJECT REFCOUNT key\n```\n\nReturn the reference count of the object (for debugging).\n\n```redis\n> OBJECT REFCOUNT mykey\n(integer) 1\n```"
1002
+ }
1003
+ ]
1004
+ },
1005
+ "MEMORY DOCTOR": {
1006
+ "contents": [
1007
+ {
1008
+ "value": "## MEMORY DOCTOR\n\n```redis\nMEMORY DOCTOR\n```\n\nReturn memory problems report.\n\n```redis\n> MEMORY DOCTOR\n\"Sam, I have no memory problems\"\n```"
1009
+ }
1010
+ ]
1011
+ },
1012
+ "LATENCY LATEST": {
1013
+ "contents": [
1014
+ {
1015
+ "value": "## LATENCY LATEST\n\n```redis\nLATENCY LATEST\n```\n\nReturn latest latency samples for all events.\n\n```redis\n> LATENCY LATEST\n1) 1) \"command\"\n 2) (integer) 1695000000\n 3) (integer) 15\n 4) (integer) 20\n```"
1016
+ }
1017
+ ]
1018
+ },
1019
+ "LATENCY HISTORY": {
1020
+ "contents": [
1021
+ {
1022
+ "value": "## LATENCY HISTORY\n\n```redis\nLATENCY HISTORY event\n```\n\nReturn latency history for a specific event.\n\n```redis\n> LATENCY HISTORY command\n1) 1) (integer) 1695000000\n 2) (integer) 15\n2) 1) (integer) 1695000001\n 2) (integer) 12\n```"
1023
+ }
1024
+ ]
1025
+ },
1026
+ "FUNCTION CALL": {
1027
+ "contents": [
1028
+ {
1029
+ "value": "## FCALL / FCALL_RO\n\n```redis\nFCALL function numkeys [key ...] [arg ...]\nFCALL_RO function numkeys [key ...] [arg ...]\n```\n\nCall a previously loaded Redis Function.\n\n```redis\n> FCALL myfunc 1 mykey\n\"value\"\n```"
1030
+ }
1031
+ ]
1032
+ },
1033
+ "FUNCTION LIST": {
1034
+ "contents": [
1035
+ {
1036
+ "value": "## FUNCTION LIST\n\n```redis\nFUNCTION LIST [LIBRARYNAME pattern] [WITHCODE]\n```\n\nList loaded function libraries.\n\n```redis\n> FUNCTION LIST\n1) 1) \"library_name\"\n 2) \"mylib\"\n 3) \"functions\"\n 4) 1) 1) \"name\"\n 2) \"myfunc\"\n```"
1037
+ }
1038
+ ]
1039
+ },
1040
+ "WAITAOF": {
1041
+ "contents": [
1042
+ {
1043
+ "value": "## WAITAOF\n\n```redis\nWAITAOF numlocal numreplicas timeout\n```\n\nWait for AOF fsync on local and replicas. Returns number of local fsyncs and replicas that acknowledged.\n\n```redis\n> WAITAOF 1 0 5000 -- wait for local fsync, 5s timeout\n1) (integer) 1\n2) (integer) 0\n```"
1044
+ }
1045
+ ]
1046
+ },
1047
+ "GETSET": {
1048
+ "contents": [
1049
+ {
1050
+ "value": "## GETSET\n\n```redis\nGETSET key value\n```\n\nAtomically set key to value and return the old value. Deprecated in favor of SET with GET option.\n\n**Group:** Strings"
1051
+ }
1052
+ ]
1053
+ },
1054
+ "MSETNX": {
1055
+ "contents": [
1056
+ {
1057
+ "value": "## MSETNX\n\n```redis\nMSETNX key value [key value ...]\n```\n\nSet multiple keys only if none of them exist. Atomic — all or nothing.\n\n**Group:** Strings"
1058
+ }
1059
+ ]
1060
+ },
1061
+ "PSETEX": {
1062
+ "contents": [
1063
+ {
1064
+ "value": "## PSETEX\n\n```redis\nPSETEX key milliseconds value\n```\n\nSet key to value with expiration in milliseconds.\n\n**Group:** Strings"
1065
+ }
1066
+ ]
1067
+ },
1068
+ "SETRANGE": {
1069
+ "contents": [
1070
+ {
1071
+ "value": "## SETRANGE\n\n```redis\nSETRANGE key offset value\n```\n\nOverwrite part of the string at key starting at offset.\n\n**Group:** Strings"
1072
+ }
1073
+ ]
1074
+ },
1075
+ "DECRBY": {
1076
+ "contents": [
1077
+ {
1078
+ "value": "## DECRBY\n\n```redis\nDECRBY key decrement\n```\n\nAtomically decrement the integer value of key by the given amount.\n\n**Group:** Strings"
1079
+ }
1080
+ ]
1081
+ },
1082
+ "SUBSTR": {
1083
+ "contents": [
1084
+ {
1085
+ "value": "## SUBSTR\n\n```redis\nSUBSTR key start end\n```\n\nReturns a substring. Deprecated alias for GETRANGE.\n\n**Group:** Strings"
1086
+ }
1087
+ ]
1088
+ },
1089
+ "HKEYS": {
1090
+ "contents": [
1091
+ {
1092
+ "value": "## HKEYS\n\n```redis\nHKEYS key\n```\n\nReturns all field names in a hash.\n\n**Group:** Hashes"
1093
+ }
1094
+ ]
1095
+ },
1096
+ "HVALS": {
1097
+ "contents": [
1098
+ {
1099
+ "value": "## HVALS\n\n```redis\nHVALS key\n```\n\nReturns all values in a hash.\n\n**Group:** Hashes"
1100
+ }
1101
+ ]
1102
+ },
1103
+ "HINCRBYFLOAT": {
1104
+ "contents": [
1105
+ {
1106
+ "value": "## HINCRBYFLOAT\n\n```redis\nHINCRBYFLOAT key field increment\n```\n\nIncrement the float value of a hash field.\n\n**Group:** Hashes"
1107
+ }
1108
+ ]
1109
+ },
1110
+ "HSETNX": {
1111
+ "contents": [
1112
+ {
1113
+ "value": "## HSETNX\n\n```redis\nHSETNX key field value\n```\n\nSet hash field only if it does not exist.\n\n**Group:** Hashes"
1114
+ }
1115
+ ]
1116
+ },
1117
+ "LSET": {
1118
+ "contents": [
1119
+ {
1120
+ "value": "## LSET\n\n```redis\nLSET key index element\n```\n\nSet the element at index in a list.\n\n**Group:** Lists"
1121
+ }
1122
+ ]
1123
+ },
1124
+ "LREM": {
1125
+ "contents": [
1126
+ {
1127
+ "value": "## LREM\n\n```redis\nLREM key count element\n```\n\nRemove count occurrences of element. count>0: head to tail; count<0: tail to head; 0: all.\n\n**Group:** Lists"
1128
+ }
1129
+ ]
1130
+ },
1131
+ "LTRIM": {
1132
+ "contents": [
1133
+ {
1134
+ "value": "## LTRIM\n\n```redis\nLTRIM key start stop\n```\n\nTrim list to the specified range.\n\n**Group:** Lists"
1135
+ }
1136
+ ]
1137
+ },
1138
+ "RPOPLPUSH": {
1139
+ "contents": [
1140
+ {
1141
+ "value": "## RPOPLPUSH\n\n```redis\nRPOPLPUSH source destination\n```\n\nPop from tail of source and push to head of destination. Deprecated — use LMOVE.\n\n**Group:** Lists"
1142
+ }
1143
+ ]
1144
+ },
1145
+ "LMPOP": {
1146
+ "contents": [
1147
+ {
1148
+ "value": "## LMPOP\n\n```redis\nLMPOP numkeys key [key ...] LEFT|RIGHT [COUNT count]\n```\n\nPop from first non-empty list. Redis 7.0+.\n\n**Group:** Lists"
1149
+ }
1150
+ ]
1151
+ },
1152
+ "BLMPOP": {
1153
+ "contents": [
1154
+ {
1155
+ "value": "## BLMPOP\n\n```redis\nBLMPOP timeout numkeys key [key ...] LEFT|RIGHT [COUNT count]\n```\n\nBlocking version of LMPOP. Redis 7.0+.\n\n**Group:** Lists"
1156
+ }
1157
+ ]
1158
+ },
1159
+ "LPUSHX": {
1160
+ "contents": [
1161
+ {
1162
+ "value": "## LPUSHX\n\n```redis\nLPUSHX key element [element ...]\n```\n\nPush to head only if list exists.\n\n**Group:** Lists"
1163
+ }
1164
+ ]
1165
+ },
1166
+ "RPUSHX": {
1167
+ "contents": [
1168
+ {
1169
+ "value": "## RPUSHX\n\n```redis\nRPUSHX key element [element ...]\n```\n\nPush to tail only if list exists.\n\n**Group:** Lists"
1170
+ }
1171
+ ]
1172
+ },
1173
+ "SMISMEMBER": {
1174
+ "contents": [
1175
+ {
1176
+ "value": "## SMISMEMBER\n\n```redis\nSMISMEMBER key member [member ...]\n```\n\nCheck multiple members. Returns array of 1/0. Redis 6.2+.\n\n**Group:** Sets"
1177
+ }
1178
+ ]
1179
+ },
1180
+ "SRANDMEMBER": {
1181
+ "contents": [
1182
+ {
1183
+ "value": "## SRANDMEMBER\n\n```redis\nSRANDMEMBER key [count]\n```\n\nGet random member(s) without removing.\n\n**Group:** Sets"
1184
+ }
1185
+ ]
1186
+ },
1187
+ "SUNIONSTORE": {
1188
+ "contents": [
1189
+ {
1190
+ "value": "## SUNIONSTORE\n\n```redis\nSUNIONSTORE destination key [key ...]\n```\n\nStore the union of sets.\n\n**Group:** Sets"
1191
+ }
1192
+ ]
1193
+ },
1194
+ "SINTERSTORE": {
1195
+ "contents": [
1196
+ {
1197
+ "value": "## SINTERSTORE\n\n```redis\nSINTERSTORE destination key [key ...]\n```\n\nStore the intersection of sets.\n\n**Group:** Sets"
1198
+ }
1199
+ ]
1200
+ },
1201
+ "SDIFFSTORE": {
1202
+ "contents": [
1203
+ {
1204
+ "value": "## SDIFFSTORE\n\n```redis\nSDIFFSTORE destination key [key ...]\n```\n\nStore the difference of sets.\n\n**Group:** Sets"
1205
+ }
1206
+ ]
1207
+ },
1208
+ "SSCAN": {
1209
+ "contents": [
1210
+ {
1211
+ "value": "## SSCAN\n\n```redis\nSSCAN key cursor [MATCH pattern] [COUNT count]\n```\n\nIncrementally iterate set members.\n\n**Group:** Sets"
1212
+ }
1213
+ ]
1214
+ },
1215
+ "ZREM": {
1216
+ "contents": [
1217
+ {
1218
+ "value": "## ZREM\n\n```redis\nZREM key member [member ...]\n```\n\nRemove members from a sorted set.\n\n**Group:** Sorted Sets"
1219
+ }
1220
+ ]
1221
+ },
1222
+ "ZMSCORE": {
1223
+ "contents": [
1224
+ {
1225
+ "value": "## ZMSCORE\n\n```redis\nZMSCORE key member [member ...]\n```\n\nGet scores of multiple members. Redis 6.2+.\n\n**Group:** Sorted Sets"
1226
+ }
1227
+ ]
1228
+ },
1229
+ "ZREVRANK": {
1230
+ "contents": [
1231
+ {
1232
+ "value": "## ZREVRANK\n\n```redis\nZREVRANK key member [WITHSCORE]\n```\n\nGet the rank of a member (0-based, descending).\n\n**Group:** Sorted Sets"
1233
+ }
1234
+ ]
1235
+ },
1236
+ "ZLEXCOUNT": {
1237
+ "contents": [
1238
+ {
1239
+ "value": "## ZLEXCOUNT\n\n```redis\nZLEXCOUNT key min max\n```\n\nCount members in a lex range when all scores are equal.\n\n**Group:** Sorted Sets"
1240
+ }
1241
+ ]
1242
+ },
1243
+ "ZRANGEBYSCORE": {
1244
+ "contents": [
1245
+ {
1246
+ "value": "## ZRANGEBYSCORE\n\n```redis\nZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]\n```\n\nReturn members with scores in range. Deprecated — use ZRANGE BYSCORE.\n\n**Group:** Sorted Sets"
1247
+ }
1248
+ ]
1249
+ },
1250
+ "ZRANGEBYLEX": {
1251
+ "contents": [
1252
+ {
1253
+ "value": "## ZRANGEBYLEX\n\n```redis\nZRANGEBYLEX key min max [LIMIT offset count]\n```\n\nReturn members in a lex range. Deprecated — use ZRANGE BYLEX.\n\n**Group:** Sorted Sets"
1254
+ }
1255
+ ]
1256
+ },
1257
+ "ZREVRANGE": {
1258
+ "contents": [
1259
+ {
1260
+ "value": "## ZREVRANGE\n\n```redis\nZREVRANGE key start stop [WITHSCORES]\n```\n\nReturn members in reverse rank order. Deprecated — use ZRANGE REV.\n\n**Group:** Sorted Sets"
1261
+ }
1262
+ ]
1263
+ },
1264
+ "ZREVRANGEBYSCORE": {
1265
+ "contents": [
1266
+ {
1267
+ "value": "## ZREVRANGEBYSCORE\n\n```redis\nZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]\n```\n\nReturn members with scores in range, descending. Deprecated.\n\n**Group:** Sorted Sets"
1268
+ }
1269
+ ]
1270
+ },
1271
+ "ZUNION": {
1272
+ "contents": [
1273
+ {
1274
+ "value": "## ZUNION\n\n```redis\nZUNION numkeys key [key ...] [WEIGHTS w ...] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]\n```\n\nReturn union without storing. Redis 6.2+.\n\n**Group:** Sorted Sets"
1275
+ }
1276
+ ]
1277
+ },
1278
+ "ZINTER": {
1279
+ "contents": [
1280
+ {
1281
+ "value": "## ZINTER\n\n```redis\nZINTER numkeys key [key ...] [WEIGHTS w ...] [AGGREGATE SUM|MIN|MAX] [WITHSCORES]\n```\n\nReturn intersection without storing. Redis 6.2+.\n\n**Group:** Sorted Sets"
1282
+ }
1283
+ ]
1284
+ },
1285
+ "ZDIFFSTORE": {
1286
+ "contents": [
1287
+ {
1288
+ "value": "## ZDIFFSTORE\n\n```redis\nZDIFFSTORE dest numkeys key [key ...]\n```\n\nStore difference of sorted sets. Redis 6.2+.\n\n**Group:** Sorted Sets"
1289
+ }
1290
+ ]
1291
+ },
1292
+ "ZDIFF": {
1293
+ "contents": [
1294
+ {
1295
+ "value": "## ZDIFF\n\n```redis\nZDIFF numkeys key [key ...] [WITHSCORES]\n```\n\nReturn difference without storing. Redis 6.2+.\n\n**Group:** Sorted Sets"
1296
+ }
1297
+ ]
1298
+ },
1299
+ "ZRANDMEMBER": {
1300
+ "contents": [
1301
+ {
1302
+ "value": "## ZRANDMEMBER\n\n```redis\nZRANDMEMBER key [count [WITHSCORES]]\n```\n\nReturn random member(s). Redis 6.2+.\n\n**Group:** Sorted Sets"
1303
+ }
1304
+ ]
1305
+ },
1306
+ "BZPOPMIN": {
1307
+ "contents": [
1308
+ {
1309
+ "value": "## BZPOPMIN\n\n```redis\nBZPOPMIN key [key ...] timeout\n```\n\nBlocking pop of member with lowest score.\n\n**Group:** Sorted Sets"
1310
+ }
1311
+ ]
1312
+ },
1313
+ "BZPOPMAX": {
1314
+ "contents": [
1315
+ {
1316
+ "value": "## BZPOPMAX\n\n```redis\nBZPOPMAX key [key ...] timeout\n```\n\nBlocking pop of member with highest score.\n\n**Group:** Sorted Sets"
1317
+ }
1318
+ ]
1319
+ },
1320
+ "ZMPOP": {
1321
+ "contents": [
1322
+ {
1323
+ "value": "## ZMPOP\n\n```redis\nZMPOP numkeys key [key ...] MIN|MAX [COUNT count]\n```\n\nPop from first non-empty sorted set. Redis 7.0+.\n\n**Group:** Sorted Sets"
1324
+ }
1325
+ ]
1326
+ },
1327
+ "BZMPOP": {
1328
+ "contents": [
1329
+ {
1330
+ "value": "## BZMPOP\n\n```redis\nBZMPOP timeout numkeys key [key ...] MIN|MAX [COUNT count]\n```\n\nBlocking version of ZMPOP. Redis 7.0+.\n\n**Group:** Sorted Sets"
1331
+ }
1332
+ ]
1333
+ },
1334
+ "ZRANGESTORE": {
1335
+ "contents": [
1336
+ {
1337
+ "value": "## ZRANGESTORE\n\n```redis\nZRANGESTORE dst src min max [BYSCORE|BYLEX] [REV] [LIMIT offset count]\n```\n\nStore specified range from sorted set. Redis 6.2+.\n\n**Group:** Sorted Sets"
1338
+ }
1339
+ ]
1340
+ },
1341
+ "ZSCAN": {
1342
+ "contents": [
1343
+ {
1344
+ "value": "## ZSCAN\n\n```redis\nZSCAN key cursor [MATCH pattern] [COUNT count]\n```\n\nIncrementally iterate sorted set members and scores.\n\n**Group:** Sorted Sets"
1345
+ }
1346
+ ]
1347
+ },
1348
+ "RENAMENX": {
1349
+ "contents": [
1350
+ {
1351
+ "value": "## RENAMENX\n\n```redis\nRENAMENX key newkey\n```\n\nRename key only if newkey does not exist.\n\n**Group:** Generic"
1352
+ }
1353
+ ]
1354
+ },
1355
+ "PEXPIRE": {
1356
+ "contents": [
1357
+ {
1358
+ "value": "## PEXPIRE\n\n```redis\nPEXPIRE key milliseconds [NX|XX|GT|LT]\n```\n\nSet TTL on key in milliseconds.\n\n**Group:** Generic"
1359
+ }
1360
+ ]
1361
+ },
1362
+ "EXPIREAT": {
1363
+ "contents": [
1364
+ {
1365
+ "value": "## EXPIREAT\n\n```redis\nEXPIREAT key unix-time-seconds [NX|XX|GT|LT]\n```\n\nSet key to expire at a Unix timestamp (seconds).\n\n**Group:** Generic"
1366
+ }
1367
+ ]
1368
+ },
1369
+ "PEXPIREAT": {
1370
+ "contents": [
1371
+ {
1372
+ "value": "## PEXPIREAT\n\n```redis\nPEXPIREAT key unix-time-milliseconds [NX|XX|GT|LT]\n```\n\nSet key to expire at a Unix timestamp (milliseconds).\n\n**Group:** Generic"
1373
+ }
1374
+ ]
1375
+ },
1376
+ "EXPIRETIME": {
1377
+ "contents": [
1378
+ {
1379
+ "value": "## EXPIRETIME\n\n```redis\nEXPIRETIME key\n```\n\nReturns the absolute Unix timestamp at which the key will expire. Redis 7.0+.\n\n**Group:** Generic"
1380
+ }
1381
+ ]
1382
+ },
1383
+ "PEXPIRETIME": {
1384
+ "contents": [
1385
+ {
1386
+ "value": "## PEXPIRETIME\n\n```redis\nPEXPIRETIME key\n```\n\nReturns the absolute Unix timestamp (ms) at which the key will expire. Redis 7.0+.\n\n**Group:** Generic"
1387
+ }
1388
+ ]
1389
+ },
1390
+ "SORT_RO": {
1391
+ "contents": [
1392
+ {
1393
+ "value": "## SORT_RO\n\n```redis\nSORT_RO key [BY pattern] [LIMIT offset count] [GET pattern ...] [ASC|DESC] [ALPHA]\n```\n\nRead-only variant of SORT. Redis 7.0+.\n\n**Group:** Generic"
1394
+ }
1395
+ ]
1396
+ },
1397
+ "MOVE": {
1398
+ "contents": [
1399
+ {
1400
+ "value": "## MOVE\n\n```redis\nMOVE key db\n```\n\nMove key to another database.\n\n**Group:** Generic"
1401
+ }
1402
+ ]
1403
+ },
1404
+ "TOUCH": {
1405
+ "contents": [
1406
+ {
1407
+ "value": "## TOUCH\n\n```redis\nTOUCH key [key ...]\n```\n\nAlter the last access time of key(s).\n\n**Group:** Generic"
1408
+ }
1409
+ ]
1410
+ },
1411
+ "WAIT": {
1412
+ "contents": [
1413
+ {
1414
+ "value": "## WAIT\n\n```redis\nWAIT numreplicas timeout\n```\n\nBlock until writes are acknowledged by N replicas or timeout.\n\n**Group:** Generic"
1415
+ }
1416
+ ]
1417
+ },
1418
+ "BITFIELD_RO": {
1419
+ "contents": [
1420
+ {
1421
+ "value": "## BITFIELD_RO\n\n```redis\nBITFIELD_RO key GET type offset [GET type offset ...]\n```\n\nRead-only variant of BITFIELD. Redis 6.0+.\n\n**Group:** Bitmaps"
1422
+ }
1423
+ ]
1424
+ },
1425
+ "XRANGE": {
1426
+ "contents": [
1427
+ {
1428
+ "value": "## XRANGE\n\n```redis\nXRANGE key start end [COUNT count]\n```\n\nReturn entries in a range. Use - and + for min/max IDs.\n\n**Group:** Streams"
1429
+ }
1430
+ ]
1431
+ },
1432
+ "XREVRANGE": {
1433
+ "contents": [
1434
+ {
1435
+ "value": "## XREVRANGE\n\n```redis\nXREVRANGE key end start [COUNT count]\n```\n\nReturn entries in reverse order.\n\n**Group:** Streams"
1436
+ }
1437
+ ]
1438
+ },
1439
+ "XGROUP DESTROY": {
1440
+ "contents": [
1441
+ {
1442
+ "value": "## XGROUP DESTROY\n\n```redis\nXGROUP DESTROY key group\n```\n\nDestroy a consumer group.\n\n**Group:** Streams"
1443
+ }
1444
+ ]
1445
+ },
1446
+ "XGROUP DELCONSUMER": {
1447
+ "contents": [
1448
+ {
1449
+ "value": "## XGROUP DELCONSUMER\n\n```redis\nXGROUP DELCONSUMER key group consumer\n```\n\nRemove a consumer from a group.\n\n**Group:** Streams"
1450
+ }
1451
+ ]
1452
+ },
1453
+ "XGROUP SETID": {
1454
+ "contents": [
1455
+ {
1456
+ "value": "## XGROUP SETID\n\n```redis\nXGROUP SETID key group id|$ [ENTRIESREAD n]\n```\n\nSet the last delivered ID of a consumer group.\n\n**Group:** Streams"
1457
+ }
1458
+ ]
1459
+ },
1460
+ "XINFO GROUPS": {
1461
+ "contents": [
1462
+ {
1463
+ "value": "## XINFO GROUPS\n\n```redis\nXINFO GROUPS key\n```\n\nList consumer groups for a stream.\n\n**Group:** Streams"
1464
+ }
1465
+ ]
1466
+ },
1467
+ "XINFO CONSUMERS": {
1468
+ "contents": [
1469
+ {
1470
+ "value": "## XINFO CONSUMERS\n\n```redis\nXINFO CONSUMERS key group\n```\n\nList consumers in a consumer group.\n\n**Group:** Streams"
1471
+ }
1472
+ ]
1473
+ },
1474
+ "XDEL": {
1475
+ "contents": [
1476
+ {
1477
+ "value": "## XDEL\n\n```redis\nXDEL key id [id ...]\n```\n\nDelete specific entries from a stream by ID.\n\n**Group:** Streams"
1478
+ }
1479
+ ]
1480
+ },
1481
+ "XSETID": {
1482
+ "contents": [
1483
+ {
1484
+ "value": "## XSETID\n\n```redis\nXSETID key last-id [ENTRIESADDED n] [MAXDELETEDID id]\n```\n\nSet the last entry ID of a stream.\n\n**Group:** Streams"
1485
+ }
1486
+ ]
1487
+ },
1488
+ "UNSUBSCRIBE": {
1489
+ "contents": [
1490
+ {
1491
+ "value": "## UNSUBSCRIBE\n\n```redis\nUNSUBSCRIBE [channel ...]\n```\n\nStop listening from channels.\n\n**Group:** Pub/Sub"
1492
+ }
1493
+ ]
1494
+ },
1495
+ "PUNSUBSCRIBE": {
1496
+ "contents": [
1497
+ {
1498
+ "value": "## PUNSUBSCRIBE\n\n```redis\nPUNSUBSCRIBE [pattern ...]\n```\n\nStop listening from pattern channels.\n\n**Group:** Pub/Sub"
1499
+ }
1500
+ ]
1501
+ },
1502
+ "PUBSUB CHANNELS": {
1503
+ "contents": [
1504
+ {
1505
+ "value": "## PUBSUB CHANNELS\n\n```redis\nPUBSUB CHANNELS [pattern]\n```\n\nList active channels. Optionally filter by pattern.\n\n**Group:** Pub/Sub"
1506
+ }
1507
+ ]
1508
+ },
1509
+ "PUBSUB NUMSUB": {
1510
+ "contents": [
1511
+ {
1512
+ "value": "## PUBSUB NUMSUB\n\n```redis\nPUBSUB NUMSUB [channel ...]\n```\n\nGet subscriber counts for channels.\n\n**Group:** Pub/Sub"
1513
+ }
1514
+ ]
1515
+ },
1516
+ "PUBSUB NUMPAT": {
1517
+ "contents": [
1518
+ {
1519
+ "value": "## PUBSUB NUMPAT\n\n```redis\nPUBSUB NUMPAT\n```\n\nGet the count of unique pattern subscriptions.\n\n**Group:** Pub/Sub"
1520
+ }
1521
+ ]
1522
+ },
1523
+ "SSUBSCRIBE": {
1524
+ "contents": [
1525
+ {
1526
+ "value": "## SSUBSCRIBE\n\n```redis\nSSUBSCRIBE channel [channel ...]\n```\n\nSubscribe to shard channels. Redis 7.0+.\n\n**Group:** Pub/Sub"
1527
+ }
1528
+ ]
1529
+ },
1530
+ "SUNSUBSCRIBE": {
1531
+ "contents": [
1532
+ {
1533
+ "value": "## SUNSUBSCRIBE\n\n```redis\nSUNSUBSCRIBE [channel ...]\n```\n\nUnsubscribe from shard channels. Redis 7.0+.\n\n**Group:** Pub/Sub"
1534
+ }
1535
+ ]
1536
+ },
1537
+ "SPUBLISH": {
1538
+ "contents": [
1539
+ {
1540
+ "value": "## SPUBLISH\n\n```redis\nSPUBLISH channel message\n```\n\nPublish to a shard channel. Redis 7.0+.\n\n**Group:** Pub/Sub"
1541
+ }
1542
+ ]
1543
+ },
1544
+ "PUBSUB SHARDCHANNELS": {
1545
+ "contents": [
1546
+ {
1547
+ "value": "## PUBSUB SHARDCHANNELS\n\n```redis\nPUBSUB SHARDCHANNELS [pattern]\n```\n\nList active shard channels. Redis 7.0+.\n\n**Group:** Pub/Sub"
1548
+ }
1549
+ ]
1550
+ },
1551
+ "PUBSUB SHARDNUMSUB": {
1552
+ "contents": [
1553
+ {
1554
+ "value": "## PUBSUB SHARDNUMSUB\n\n```redis\nPUBSUB SHARDNUMSUB [channel ...]\n```\n\nGet shard channel subscriber counts. Redis 7.0+.\n\n**Group:** Pub/Sub"
1555
+ }
1556
+ ]
1557
+ },
1558
+ "UNWATCH": {
1559
+ "contents": [
1560
+ {
1561
+ "value": "## UNWATCH\n\n```redis\nUNWATCH\n```\n\nForget all watched keys.\n\n**Group:** Transactions"
1562
+ }
1563
+ ]
1564
+ },
1565
+ "EVALRO": {
1566
+ "contents": [
1567
+ {
1568
+ "value": "## EVALRO\n\n```redis\nEVALRO script numkeys [key ...] [arg ...]\n```\n\nExecute Lua script in read-only mode. Redis 7.0+.\n\n**Group:** Scripting"
1569
+ }
1570
+ ]
1571
+ },
1572
+ "EVALSHA_RO": {
1573
+ "contents": [
1574
+ {
1575
+ "value": "## EVALSHA_RO\n\n```redis\nEVALSHA_RO sha1 numkeys [key ...] [arg ...]\n```\n\nExecute cached script in read-only mode. Redis 7.0+.\n\n**Group:** Scripting"
1576
+ }
1577
+ ]
1578
+ },
1579
+ "SCRIPT LOAD": {
1580
+ "contents": [
1581
+ {
1582
+ "value": "## SCRIPT LOAD\n\n```redis\nSCRIPT LOAD script\n```\n\nLoad a Lua script into the script cache. Returns SHA1 hash.\n\n**Group:** Scripting"
1583
+ }
1584
+ ]
1585
+ },
1586
+ "SCRIPT EXISTS": {
1587
+ "contents": [
1588
+ {
1589
+ "value": "## SCRIPT EXISTS\n\n```redis\nSCRIPT EXISTS sha1 [sha1 ...]\n```\n\nCheck if scripts exist in the script cache.\n\n**Group:** Scripting"
1590
+ }
1591
+ ]
1592
+ },
1593
+ "SCRIPT FLUSH": {
1594
+ "contents": [
1595
+ {
1596
+ "value": "## SCRIPT FLUSH\n\n```redis\nSCRIPT FLUSH [ASYNC|SYNC]\n```\n\nRemove all scripts from the script cache.\n\n**Group:** Scripting"
1597
+ }
1598
+ ]
1599
+ },
1600
+ "SCRIPT KILL": {
1601
+ "contents": [
1602
+ {
1603
+ "value": "## SCRIPT KILL\n\n```redis\nSCRIPT KILL\n```\n\nKill the currently executing Lua script.\n\n**Group:** Scripting"
1604
+ }
1605
+ ]
1606
+ },
1607
+ "FCALL_RO": {
1608
+ "contents": [
1609
+ {
1610
+ "value": "## FCALL_RO\n\n```redis\nFCALL_RO function numkeys [key ...] [arg ...]\n```\n\nCall a function in read-only mode. Redis 7.0+.\n\n**Group:** Scripting"
1611
+ }
1612
+ ]
1613
+ },
1614
+ "FUNCTION DUMP": {
1615
+ "contents": [
1616
+ {
1617
+ "value": "## FUNCTION DUMP\n\n```redis\nFUNCTION DUMP\n```\n\nSerialize all loaded functions. Redis 7.0+.\n\n**Group:** Scripting"
1618
+ }
1619
+ ]
1620
+ },
1621
+ "FUNCTION RESTORE": {
1622
+ "contents": [
1623
+ {
1624
+ "value": "## FUNCTION RESTORE\n\n```redis\nFUNCTION RESTORE serialized-data [FLUSH|APPEND|REPLACE]\n```\n\nRestore functions from FUNCTION DUMP. Redis 7.0+.\n\n**Group:** Scripting"
1625
+ }
1626
+ ]
1627
+ },
1628
+ "FUNCTION FLUSH": {
1629
+ "contents": [
1630
+ {
1631
+ "value": "## FUNCTION FLUSH\n\n```redis\nFUNCTION FLUSH [ASYNC|SYNC]\n```\n\nDelete all loaded functions. Redis 7.0+.\n\n**Group:** Scripting"
1632
+ }
1633
+ ]
1634
+ },
1635
+ "FUNCTION DELETE": {
1636
+ "contents": [
1637
+ {
1638
+ "value": "## FUNCTION DELETE\n\n```redis\nFUNCTION DELETE library-name\n```\n\nDelete a function library. Redis 7.0+.\n\n**Group:** Scripting"
1639
+ }
1640
+ ]
1641
+ },
1642
+ "FUNCTION STATS": {
1643
+ "contents": [
1644
+ {
1645
+ "value": "## FUNCTION STATS\n\n```redis\nFUNCTION STATS\n```\n\nGet function execution statistics. Redis 7.0+.\n\n**Group:** Scripting"
1646
+ }
1647
+ ]
1648
+ },
1649
+ "GEOHASH": {
1650
+ "contents": [
1651
+ {
1652
+ "value": "## GEOHASH\n\n```redis\nGEOHASH key member [member ...]\n```\n\nReturn Geohash strings representing positions.\n\n**Group:** Geo"
1653
+ }
1654
+ ]
1655
+ },
1656
+ "GEOPOS": {
1657
+ "contents": [
1658
+ {
1659
+ "value": "## GEOPOS\n\n```redis\nGEOPOS key member [member ...]\n```\n\nReturn longitude/latitude of members.\n\n**Group:** Geo"
1660
+ }
1661
+ ]
1662
+ },
1663
+ "GEOSEARCHSTORE": {
1664
+ "contents": [
1665
+ {
1666
+ "value": "## GEOSEARCHSTORE\n\n```redis\nGEOSEARCHSTORE dest src FROMMEMBER member|FROMLONLAT lon lat BYRADIUS ...|BYBOX ... [ASC|DESC] [COUNT n] [STOREDIST]\n```\n\nStore GEOSEARCH results. Redis 6.2+.\n\n**Group:** Geo"
1667
+ }
1668
+ ]
1669
+ },
1670
+ "GEORADIUS": {
1671
+ "contents": [
1672
+ {
1673
+ "value": "## GEORADIUS\n\n```redis\nGEORADIUS key longitude latitude radius M|KM|FT|MI [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT n] [ASC|DESC] [STORE key] [STOREDIST key]\n```\n\nQuery by radius from coordinates. Deprecated — use GEOSEARCH.\n\n**Group:** Geo"
1674
+ }
1675
+ ]
1676
+ },
1677
+ "GEORADIUSBYMEMBER": {
1678
+ "contents": [
1679
+ {
1680
+ "value": "## GEORADIUSBYMEMBER\n\n```redis\nGEORADIUSBYMEMBER key member radius M|KM|FT|MI ...\n```\n\nQuery by radius from a member. Deprecated — use GEOSEARCH.\n\n**Group:** Geo"
1681
+ }
1682
+ ]
1683
+ },
1684
+ "CONFIG RESETSTAT": {
1685
+ "contents": [
1686
+ {
1687
+ "value": "## CONFIG RESETSTAT\n\n```redis\nCONFIG RESETSTAT\n```\n\nReset the statistics returned by INFO.\n\n**Group:** Server"
1688
+ }
1689
+ ]
1690
+ },
1691
+ "CONFIG REWRITE": {
1692
+ "contents": [
1693
+ {
1694
+ "value": "## CONFIG REWRITE\n\n```redis\nCONFIG REWRITE\n```\n\nRewrite the redis.conf file with current in-memory configuration.\n\n**Group:** Server"
1695
+ }
1696
+ ]
1697
+ },
1698
+ "BGREWRITEAOF": {
1699
+ "contents": [
1700
+ {
1701
+ "value": "## BGREWRITEAOF\n\n```redis\nBGREWRITEAOF\n```\n\nTrigger an asynchronous AOF rewrite.\n\n**Group:** Server"
1702
+ }
1703
+ ]
1704
+ },
1705
+ "SAVE": {
1706
+ "contents": [
1707
+ {
1708
+ "value": "## SAVE\n\n```redis\nSAVE\n```\n\nSynchronously save the dataset to disk. BLOCKS the server.\n\n**Group:** Server"
1709
+ }
1710
+ ]
1711
+ },
1712
+ "LASTSAVE": {
1713
+ "contents": [
1714
+ {
1715
+ "value": "## LASTSAVE\n\n```redis\nLASTSAVE\n```\n\nReturn the Unix timestamp of the last successful RDB save.\n\n**Group:** Server"
1716
+ }
1717
+ ]
1718
+ },
1719
+ "SHUTDOWN": {
1720
+ "contents": [
1721
+ {
1722
+ "value": "## SHUTDOWN\n\n```redis\nSHUTDOWN [NOSAVE|SAVE] [NOW] [FORCE]\n```\n\nSynchronously save (unless NOSAVE) and shut down the server.\n\n**Group:** Server"
1723
+ }
1724
+ ]
1725
+ },
1726
+ "SLOWLOG LEN": {
1727
+ "contents": [
1728
+ {
1729
+ "value": "## SLOWLOG LEN\n\n```redis\nSLOWLOG LEN\n```\n\nGet the number of entries in the slow log.\n\n**Group:** Server"
1730
+ }
1731
+ ]
1732
+ },
1733
+ "SLOWLOG RESET": {
1734
+ "contents": [
1735
+ {
1736
+ "value": "## SLOWLOG RESET\n\n```redis\nSLOWLOG RESET\n```\n\nReset the slow log.\n\n**Group:** Server"
1737
+ }
1738
+ ]
1739
+ },
1740
+ "TIME": {
1741
+ "contents": [
1742
+ {
1743
+ "value": "## TIME\n\n```redis\nTIME\n```\n\nReturn the current server time as [unix-seconds, microseconds].\n\n**Group:** Server"
1744
+ }
1745
+ ]
1746
+ },
1747
+ "CLIENT ID": {
1748
+ "contents": [
1749
+ {
1750
+ "value": "## CLIENT ID\n\n```redis\nCLIENT ID\n```\n\nReturn the ID of the current connection.\n\n**Group:** Server"
1751
+ }
1752
+ ]
1753
+ },
1754
+ "CLIENT GETNAME": {
1755
+ "contents": [
1756
+ {
1757
+ "value": "## CLIENT GETNAME\n\n```redis\nCLIENT GETNAME\n```\n\nGet the name of the current connection.\n\n**Group:** Server"
1758
+ }
1759
+ ]
1760
+ },
1761
+ "CLIENT PAUSE": {
1762
+ "contents": [
1763
+ {
1764
+ "value": "## CLIENT PAUSE\n\n```redis\nCLIENT PAUSE timeout [WRITE|ALL]\n```\n\nPause all clients for timeout milliseconds.\n\n**Group:** Server"
1765
+ }
1766
+ ]
1767
+ },
1768
+ "CLIENT UNPAUSE": {
1769
+ "contents": [
1770
+ {
1771
+ "value": "## CLIENT UNPAUSE\n\n```redis\nCLIENT UNPAUSE\n```\n\nResume client processing after CLIENT PAUSE.\n\n**Group:** Server"
1772
+ }
1773
+ ]
1774
+ },
1775
+ "CLIENT NO-EVICT": {
1776
+ "contents": [
1777
+ {
1778
+ "value": "## CLIENT NO-EVICT\n\n```redis\nCLIENT NO-EVICT ON|OFF\n```\n\nExempt current connection from client eviction. Redis 7.0+.\n\n**Group:** Server"
1779
+ }
1780
+ ]
1781
+ },
1782
+ "CLIENT NO-TOUCH": {
1783
+ "contents": [
1784
+ {
1785
+ "value": "## CLIENT NO-TOUCH\n\n```redis\nCLIENT NO-TOUCH ON|OFF\n```\n\nDon't update key access time for current connection. Redis 7.2+.\n\n**Group:** Server"
1786
+ }
1787
+ ]
1788
+ },
1789
+ "ECHO": {
1790
+ "contents": [
1791
+ {
1792
+ "value": "## ECHO\n\n```redis\nECHO message\n```\n\nEcho the given message back.\n\n**Group:** Server"
1793
+ }
1794
+ ]
1795
+ },
1796
+ "SWAPDB": {
1797
+ "contents": [
1798
+ {
1799
+ "value": "## SWAPDB\n\n```redis\nSWAPDB db1 db2\n```\n\nSwap two Redis databases atomically.\n\n**Group:** Server"
1800
+ }
1801
+ ]
1802
+ },
1803
+ "MEMORY STATS": {
1804
+ "contents": [
1805
+ {
1806
+ "value": "## MEMORY STATS\n\n```redis\nMEMORY STATS\n```\n\nGet detailed memory statistics.\n\n**Group:** Server"
1807
+ }
1808
+ ]
1809
+ },
1810
+ "MEMORY PURGE": {
1811
+ "contents": [
1812
+ {
1813
+ "value": "## MEMORY PURGE\n\n```redis\nMEMORY PURGE\n```\n\nAsk allocator to release memory.\n\n**Group:** Server"
1814
+ }
1815
+ ]
1816
+ },
1817
+ "MEMORY MALLOC-STATS": {
1818
+ "contents": [
1819
+ {
1820
+ "value": "## MEMORY MALLOC-STATS\n\n```redis\nMEMORY MALLOC-STATS\n```\n\nShow internal allocator statistics.\n\n**Group:** Server"
1821
+ }
1822
+ ]
1823
+ },
1824
+ "LATENCY RESET": {
1825
+ "contents": [
1826
+ {
1827
+ "value": "## LATENCY RESET\n\n```redis\nLATENCY RESET [event ...]\n```\n\nReset latency data for events.\n\n**Group:** Server"
1828
+ }
1829
+ ]
1830
+ },
1831
+ "LATENCY GRAPH": {
1832
+ "contents": [
1833
+ {
1834
+ "value": "## LATENCY GRAPH\n\n```redis\nLATENCY GRAPH event\n```\n\nRender an ASCII art latency graph for an event.\n\n**Group:** Server"
1835
+ }
1836
+ ]
1837
+ },
1838
+ "COMMAND COUNT": {
1839
+ "contents": [
1840
+ {
1841
+ "value": "## COMMAND COUNT\n\n```redis\nCOMMAND COUNT\n```\n\nGet total number of commands supported by the server.\n\n**Group:** Server"
1842
+ }
1843
+ ]
1844
+ },
1845
+ "COMMAND LIST": {
1846
+ "contents": [
1847
+ {
1848
+ "value": "## COMMAND LIST\n\n```redis\nCOMMAND LIST [MODULE module] [ACLCAT cat] [PATTERN pattern]\n```\n\nList all command names.\n\n**Group:** Server"
1849
+ }
1850
+ ]
1851
+ },
1852
+ "COMMAND INFO": {
1853
+ "contents": [
1854
+ {
1855
+ "value": "## COMMAND INFO\n\n```redis\nCOMMAND INFO [command ...]\n```\n\nGet details about specific commands.\n\n**Group:** Server"
1856
+ }
1857
+ ]
1858
+ },
1859
+ "COMMAND GETKEYS": {
1860
+ "contents": [
1861
+ {
1862
+ "value": "## COMMAND GETKEYS\n\n```redis\nCOMMAND GETKEYS command [arg ...]\n```\n\nExtract keys from a full command.\n\n**Group:** Server"
1863
+ }
1864
+ ]
1865
+ },
1866
+ "COMMAND DOCS": {
1867
+ "contents": [
1868
+ {
1869
+ "value": "## COMMAND DOCS\n\n```redis\nCOMMAND DOCS [command ...]\n```\n\nGet documentation for commands. Redis 7.0+.\n\n**Group:** Server"
1870
+ }
1871
+ ]
1872
+ },
1873
+ "ACL LIST": {
1874
+ "contents": [
1875
+ {
1876
+ "value": "## ACL LIST\n\n```redis\nACL LIST\n```\n\nList all users and their ACL rules.\n\n**Group:** ACL"
1877
+ }
1878
+ ]
1879
+ },
1880
+ "ACL USERS": {
1881
+ "contents": [
1882
+ {
1883
+ "value": "## ACL USERS\n\n```redis\nACL USERS\n```\n\nList all configured usernames.\n\n**Group:** ACL"
1884
+ }
1885
+ ]
1886
+ },
1887
+ "ACL WHOAMI": {
1888
+ "contents": [
1889
+ {
1890
+ "value": "## ACL WHOAMI\n\n```redis\nACL WHOAMI\n```\n\nReturn the username of the current connection.\n\n**Group:** ACL"
1891
+ }
1892
+ ]
1893
+ },
1894
+ "ACL LOG": {
1895
+ "contents": [
1896
+ {
1897
+ "value": "## ACL LOG\n\n```redis\nACL LOG [count|RESET]\n```\n\nShow recent security events (failed auth, denied commands).\n\n**Group:** ACL"
1898
+ }
1899
+ ]
1900
+ },
1901
+ "ACL SAVE": {
1902
+ "contents": [
1903
+ {
1904
+ "value": "## ACL SAVE\n\n```redis\nACL SAVE\n```\n\nSave the current ACL rules to the configured ACL file.\n\n**Group:** ACL"
1905
+ }
1906
+ ]
1907
+ },
1908
+ "ACL LOAD": {
1909
+ "contents": [
1910
+ {
1911
+ "value": "## ACL LOAD\n\n```redis\nACL LOAD\n```\n\nLoad ACL rules from the configured ACL file.\n\n**Group:** ACL"
1912
+ }
1913
+ ]
1914
+ },
1915
+ "CLUSTER MYID": {
1916
+ "contents": [
1917
+ {
1918
+ "value": "## CLUSTER MYID\n\n```redis\nCLUSTER MYID\n```\n\nReturn the node's cluster ID.\n\n**Group:** Cluster"
1919
+ }
1920
+ ]
1921
+ },
1922
+ "CLUSTER SLOTS": {
1923
+ "contents": [
1924
+ {
1925
+ "value": "## CLUSTER SLOTS\n\n```redis\nCLUSTER SLOTS\n```\n\nGet mapping of hash slots to nodes. Deprecated — use CLUSTER SHARDS.\n\n**Group:** Cluster"
1926
+ }
1927
+ ]
1928
+ },
1929
+ "CLUSTER SHARDS": {
1930
+ "contents": [
1931
+ {
1932
+ "value": "## CLUSTER SHARDS\n\n```redis\nCLUSTER SHARDS\n```\n\nGet detailed shard information. Redis 7.0+.\n\n**Group:** Cluster"
1933
+ }
1934
+ ]
1935
+ },
1936
+ "CLUSTER MEET": {
1937
+ "contents": [
1938
+ {
1939
+ "value": "## CLUSTER MEET\n\n```redis\nCLUSTER MEET ip port\n```\n\nAdd a node to the cluster.\n\n**Group:** Cluster"
1940
+ }
1941
+ ]
1942
+ },
1943
+ "CLUSTER FORGET": {
1944
+ "contents": [
1945
+ {
1946
+ "value": "## CLUSTER FORGET\n\n```redis\nCLUSTER FORGET node-id\n```\n\nRemove a node from the cluster's known nodes.\n\n**Group:** Cluster"
1947
+ }
1948
+ ]
1949
+ },
1950
+ "CLUSTER REPLICATE": {
1951
+ "contents": [
1952
+ {
1953
+ "value": "## CLUSTER REPLICATE\n\n```redis\nCLUSTER REPLICATE node-id\n```\n\nMake current node a replica of the specified master.\n\n**Group:** Cluster"
1954
+ }
1955
+ ]
1956
+ },
1957
+ "CLUSTER RESET": {
1958
+ "contents": [
1959
+ {
1960
+ "value": "## CLUSTER RESET\n\n```redis\nCLUSTER RESET [HARD|SOFT]\n```\n\nReset the cluster configuration of the node.\n\n**Group:** Cluster"
1961
+ }
1962
+ ]
1963
+ },
1964
+ "CLUSTER DELSLOTS": {
1965
+ "contents": [
1966
+ {
1967
+ "value": "## CLUSTER DELSLOTS\n\n```redis\nCLUSTER DELSLOTS slot [slot ...]\n```\n\nRemove hash slots from this node.\n\n**Group:** Cluster"
1968
+ }
1969
+ ]
1970
+ },
1971
+ "CLUSTER SETSLOT": {
1972
+ "contents": [
1973
+ {
1974
+ "value": "## CLUSTER SETSLOT\n\n```redis\nCLUSTER SETSLOT slot IMPORTING|MIGRATING|NODE|STABLE [node-id]\n```\n\nBind, migrate, or stabilize a hash slot.\n\n**Group:** Cluster"
1975
+ }
1976
+ ]
1977
+ },
1978
+ "CLUSTER COUNTKEYSINSLOT": {
1979
+ "contents": [
1980
+ {
1981
+ "value": "## CLUSTER COUNTKEYSINSLOT\n\n```redis\nCLUSTER COUNTKEYSINSLOT slot\n```\n\nCount keys in a specific hash slot.\n\n**Group:** Cluster"
1982
+ }
1983
+ ]
1984
+ },
1985
+ "CLUSTER GETKEYSINSLOT": {
1986
+ "contents": [
1987
+ {
1988
+ "value": "## CLUSTER GETKEYSINSLOT\n\n```redis\nCLUSTER GETKEYSINSLOT slot count\n```\n\nReturn keys assigned to a hash slot.\n\n**Group:** Cluster"
1989
+ }
1990
+ ]
1991
+ },
1992
+ "CLUSTER KEYSLOT": {
1993
+ "contents": [
1994
+ {
1995
+ "value": "## CLUSTER KEYSLOT\n\n```redis\nCLUSTER KEYSLOT key\n```\n\nReturn the hash slot number for a key.\n\n**Group:** Cluster"
1996
+ }
1997
+ ]
1998
+ },
1999
+ "CLUSTER LINKS": {
2000
+ "contents": [
2001
+ {
2002
+ "value": "## CLUSTER LINKS\n\n```redis\nCLUSTER LINKS\n```\n\nList cluster bus connections. Redis 7.0+.\n\n**Group:** Cluster"
2003
+ }
2004
+ ]
2005
+ },
2006
+ "CLUSTER FLUSHSLOTS": {
2007
+ "contents": [
2008
+ {
2009
+ "value": "## CLUSTER FLUSHSLOTS\n\n```redis\nCLUSTER FLUSHSLOTS\n```\n\nDelete all slot assignments from this node.\n\n**Group:** Cluster"
2010
+ }
2011
+ ]
2012
+ },
2013
+ "CLUSTER SAVECONFIG": {
2014
+ "contents": [
2015
+ {
2016
+ "value": "## CLUSTER SAVECONFIG\n\n```redis\nCLUSTER SAVECONFIG\n```\n\nSave the cluster configuration to nodes.conf.\n\n**Group:** Cluster"
2017
+ }
2018
+ ]
2019
+ },
2020
+ "READONLY": {
2021
+ "contents": [
2022
+ {
2023
+ "value": "## READONLY\n\n```redis\nREADONLY\n```\n\nEnable read queries on a cluster replica. Allows reading from replicas.\n\n**Group:** Cluster"
2024
+ }
2025
+ ]
2026
+ },
2027
+ "READWRITE": {
2028
+ "contents": [
2029
+ {
2030
+ "value": "## READWRITE\n\n```redis\nREADWRITE\n```\n\nDisable READONLY mode. Replica rejects read queries.\n\n**Group:** Cluster"
2031
+ }
2032
+ ]
2033
+ },
2034
+ "SLAVEOF": {
2035
+ "contents": [
2036
+ {
2037
+ "value": "## SLAVEOF\n\n```redis\nSLAVEOF host port | SLAVEOF NO ONE\n```\n\nLegacy alias for REPLICAOF.\n\n**Group:** Replication"
2038
+ }
2039
+ ]
2040
+ },
2041
+ "FAILOVER": {
2042
+ "contents": [
2043
+ {
2044
+ "value": "## FAILOVER\n\n```redis\nFAILOVER [TO host port [FORCE]] [ABORT] [TIMEOUT ms]\n```\n\nCoordinated failover to a replica. Redis 6.2+.\n\n**Group:** Replication"
2045
+ }
2046
+ ]
2047
+ },
2048
+ "MODULE LOAD": {
2049
+ "contents": [
2050
+ {
2051
+ "value": "## MODULE LOAD\n\n```redis\nMODULE LOAD path [arg ...]\n```\n\nLoad a Redis module from a shared library.\n\n**Group:** Modules"
2052
+ }
2053
+ ]
2054
+ },
2055
+ "MODULE LIST": {
2056
+ "contents": [
2057
+ {
2058
+ "value": "## MODULE LIST\n\n```redis\nMODULE LIST\n```\n\nList all loaded modules.\n\n**Group:** Modules"
2059
+ }
2060
+ ]
2061
+ },
2062
+ "MODULE UNLOAD": {
2063
+ "contents": [
2064
+ {
2065
+ "value": "## MODULE UNLOAD\n\n```redis\nMODULE UNLOAD name\n```\n\nUnload a loaded Redis module.\n\n**Group:** Modules"
2066
+ }
2067
+ ]
2068
+ },
2069
+ "MODULE LOADEX": {
2070
+ "contents": [
2071
+ {
2072
+ "value": "## MODULE LOADEX\n\n```redis\nMODULE LOADEX path [CONFIG name value ...] [ARGS arg ...]\n```\n\nLoad module with configuration. Redis 7.0+.\n\n**Group:** Modules"
2073
+ }
2074
+ ]
2075
+ },
2076
+ "MIGRATE": {
2077
+ "contents": [
2078
+ {
2079
+ "value": "## MIGRATE\n\n```redis\nMIGRATE host port key|\"\" db timeout [COPY] [REPLACE] [AUTH password] [AUTH2 username password] [KEYS key ...]\n```\n\nAtomically transfer a key to another Redis instance.\n\n**Group:** Generic"
2080
+ }
2081
+ ]
2082
+ },
2083
+ "RESET": {
2084
+ "contents": [
2085
+ {
2086
+ "value": "## RESET\n\n```redis\nRESET\n```\n\nReset the connection state to default.\n\n**Group:** Connection"
2087
+ }
2088
+ ]
2089
+ },
2090
+ "QUIT": {
2091
+ "contents": [
2092
+ {
2093
+ "value": "## QUIT\n\n```redis\nQUIT\n```\n\nClose the connection. Client should close after receiving OK.\n\n**Group:** Connection"
2094
+ }
2095
+ ]
2096
+ },
2097
+ "HELLO": {
2098
+ "contents": [
2099
+ {
2100
+ "value": "## HELLO\n\n```redis\nHELLO [protover [AUTH username password] [SETNAME clientname]]\n```\n\nSwitch RESP protocol version (2 or 3). Redis 6.0+.\n\n**Group:** Connection"
2101
+ }
2102
+ ]
2103
+ },
2104
+ "string": {
2105
+ "contents": [
2106
+ {
2107
+ "value": "## string\n\n```redis\nRedis String\n```\n\nThe most basic Redis data type. A string value can be at most 512 MB. Used for caching, counters, sessions, and general key-value storage.\n\n**Group:** Data Types"
2108
+ }
2109
+ ]
2110
+ },
2111
+ "list": {
2112
+ "contents": [
2113
+ {
2114
+ "value": "## list\n\n```redis\nRedis List\n```\n\nOrdered collection of strings. Implemented as linked list. Supports push/pop from both ends. Used for queues, stacks, and recent-items lists.\n\n**Group:** Data Types"
2115
+ }
2116
+ ]
2117
+ },
2118
+ "set": {
2119
+ "contents": [
2120
+ {
2121
+ "value": "## set\n\n```redis\nRedis Set\n```\n\nUnordered collection of unique strings. Supports add, remove, membership test, and set operations (union, intersection, difference).\n\n**Group:** Data Types"
2122
+ }
2123
+ ]
2124
+ },
2125
+ "zset": {
2126
+ "contents": [
2127
+ {
2128
+ "value": "## zset\n\n```redis\nRedis Sorted Set\n```\n\nSet of unique strings ordered by a floating-point score. Supports range queries by score or rank. Used for leaderboards, rate limiters, priority queues.\n\n**Group:** Data Types"
2129
+ }
2130
+ ]
2131
+ },
2132
+ "hash": {
2133
+ "contents": [
2134
+ {
2135
+ "value": "## hash\n\n```redis\nRedis Hash\n```\n\nMap of field-value pairs. Memory-efficient for representing objects. Each hash can store over 4 billion field-value pairs.\n\n**Group:** Data Types"
2136
+ }
2137
+ ]
2138
+ },
2139
+ "stream": {
2140
+ "contents": [
2141
+ {
2142
+ "value": "## stream\n\n```redis\nRedis Stream\n```\n\nAppend-only log data structure. Supports consumer groups for reliable message processing. Used for event sourcing, message queues, activity feeds.\n\n**Group:** Data Types"
2143
+ }
2144
+ ]
2145
+ },
2146
+ "hyperloglog": {
2147
+ "contents": [
2148
+ {
2149
+ "value": "## hyperloglog\n\n```redis\nRedis HyperLogLog\n```\n\nProbabilistic data structure for approximate cardinality counting. Uses ~12 KB regardless of set size. 0.81% standard error.\n\n**Group:** Data Types"
2150
+ }
2151
+ ]
2152
+ },
2153
+ "bitmap": {
2154
+ "contents": [
2155
+ {
2156
+ "value": "## bitmap\n\n```redis\nRedis Bitmap\n```\n\nString type interpreted as an array of bits. Space-efficient for storing boolean information across a large key space.\n\n**Group:** Data Types"
2157
+ }
2158
+ ]
2159
+ },
2160
+ "geospatial": {
2161
+ "contents": [
2162
+ {
2163
+ "value": "## geospatial\n\n```redis\nRedis Geospatial Index\n```\n\nSorted set with geohash-encoded coordinates. Supports radius/box queries, distance calculations. Built on sorted sets internally.\n\n**Group:** Data Types"
2164
+ }
2165
+ ]
2166
+ }
2167
+ }
2168
+ }