-
Notifications
You must be signed in to change notification settings - Fork 43
/
supported-commands.md
429 lines (371 loc) · 54.1 KB
/
supported-commands.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# Supported commands
## String commands
| Command | Supported OR Not | Since Version | Description |
| ----------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |
| APPEND | ✓ | v1.0.0 | Appends a value to a key's existing string value. |
| DECR | ✓ | v1.0.0 | Decrements the number stored at a key by one. |
| DECRBY | ✓ | v1.0.0 | Decrements the number stored at a key by a specified value. |
| GET | ✓ | v1.0.0 | Retrieves the value of a key. |
| GETEX | ✓ | v2.2.0 | Retrieves and optionally sets a new expiration for the value of a key. |
| GETRANGE | ✓ | v1.0.0 | Retrieves a substring from the string stored at a key. |
| SUBSTR | ✓ | v2.4.0 | Returns a substring of the value stored at a key (alias for `GETRANGE`). |
| GETSET | ✓ | v1.0.0 | Sets the value of a key and returns its old value. |
| INCR | ✓ | v1.0.0 | Increments the number stored at a key by one. |
| INCRBY | ✓ | v1.0.0 | Increments the number stored at a key by a specified value. |
| INCRBYFLOAT | ✓ | v1.0.0 | Increments the number stored at a key by a floating-point value. |
| MGET | ✓ | v1.0.0 | Retrieves the values of multiple keys. |
| MSET | ✓ | v1.0.0 | Sets multiple keys to multiple values. |
| MSETNX | ✓ | v1.3.0 | Sets multiple keys to multiple values only if none of the keys exist. |
| PSETEX | ✓ | v1.3.0 | Sets the value of a key and sets its expiration time in milliseconds. (precision is in seconds if old encoding is used (see [#1033](https://github.com/apache/kvrocks/issues/1033))) |
| SET | ✓ | v1.0.0 | Sets the value of a key. (supported `KEEPTTL` and `GET` options since v2.8.0) |
| SETEX | ✓ | v1.0.0 | Sets the value of a key and sets its expiration time in seconds. |
| SETNX | ✓ | v1.0.0 | Sets the value of a key only if the key does not already exist. |
| SETRANGE | ✓ | v1.0.0 | Overwrites part of a string at key starting at the specified offset. |
| STRLEN | ✓ | v1.0.0 | Returns the length of the string value stored at a key. |
| CAS | ✓ | v2.0.5 | Performs a Compare-And-Swap operation, updating a value only if it matches an expected value. (see [#415](https://github.com/apache/kvrocks/pull/415)) |
| CAD | ✓ | v2.0.5 | Executes a Compare-And-Delete operation, deleting a key only if it matches an expected value. (see [#415](https://github.com/apache/kvrocks/pull/415)) |
| GETDEL | ✓ | v2.2.0 | Retrieves the value of a key and deletes the key afterward. |
| LCS | ✓ | v2.9.0 | Finds the longest common substring between the string stored at a key and another string. |
## Hash commands
| Command | Supported OR Not | Since Version | Description |
| ------------ | ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------- |
| HDEL | ✓ | v1.0.0 | Deletes one or more fields from a hash. |
| HEXISTS | ✓ | v1.0.0 | Checks if a field exists in a hash. |
| HGET | ✓ | v1.0.0 | Retrieves the value associated with a field in a hash. |
| HGETALL | ✓ | v1.0.0 | Retrieves all fields and values in a hash. |
| HINCRBY | ✓ | v1.0.0 | Increments the integer value of a field in a hash by a specified amount. |
| HINCRBYFLOAT | ✓ | v1.0.0 | Increments the floating-point value of a field in a hash by a specified amount. |
| HKEYS | ✓ | v1.0.0 | Retrieves all the fields in a hash. |
| HLEN | ✓ | v1.0.0 | Returns the number of fields in a hash. |
| HMGET | ✓ | v1.0.0 | Retrieves the values associated with multiple fields in a hash. |
| HMSET | ✓ | v1.0.0 | Sets multiple fields in a hash to multiple values. |
| HRANGEBYLEX | ✓ | v2.3.0 | Returns elements in a sorted set within a specific range defined by lexicographical ordering. |
| HSET | ✓ | v1.0.0 | Sets the value of a field in a hash. |
| HSETNX | ✓ | v1.0.0 | |
| HSTRLEN | ✓ | v1.0.0 | |
| HVALS | ✓ | v1.0.0 | |
| HSCAN | ✓ | v1.0.0 | |
| HRANDFIELD | ✓ | v2.6.0 | |
## List commands
| Command | Supported OR Not | Since Version | Desc |
| ---------- | ---------------- | ------------- | --------------------------------------------------------- |
| BLPOP | ✓ | v1.0.0 | Removes and returns the first element of a list, or blocks until one is available. |
| BRPOP | ✓ | v1.0.0 | Removes and returns the last element of a list, or blocks until one is available. |
| BRPOPLPUSH | 𐄂 | - | Pops the last element from a list, pushes it to another list, and returns it; blocks until an element is available.(DEPRECATED) |
| LINDEX | ✓ | v1.0.0 | Returns the element at a specified index in a list. (`O(N)` operation, do not use it when the list is too long) |
| LINSERT | ✓ | v1.0.0 | Inserts an element before or after another element in a list. (`O(N)` operation, do not use it when the list is too long) |
| LLEN | ✓ | v1.0.0 | Returns the length of a list. |
| LPOP | ✓ | v1.0.0 | Removes and returns the first element of a list. |
| LPUSH | ✓ | v1.0.0 | Inserts one or more elements at the head of a list. |
| LPUSHX | ✓ | v1.0.0 | Inserts an element at the head of a list, only if the list exists. |
| LRANGE | ✓ | v1.0.0 | Returns a range of elements from a list. |
| LREM | ✓ | v1.0.0 | Removes elements from a list that match a specified value. (`O(N)` operation, do not use it when the list is too long) |
| LSET | ✓ | v1.0.0 | Sets the value of an element in a list by its index. |
| LTRIM | ✓ | v1.0.0 | Trims a list to the specified range of elements. (`O(N)` operation, do not use it when the list is too long) |
| RPOP | ✓ | v1.0.0 | Removes and returns the last element of a list. |
| RPOPLPUSH | ✓ | v1.0.0 | Removes the last element from a list and pushes it onto another list. |
| RPUSH | ✓ | v1.0.0 | Inserts one or more elements at the tail of a list. |
| RPUSHX | ✓ | v1.0.0 | Inserts an element at the tail of a list, only if the list exists. |
| LMOVE | ✓ | v2.1.0 | Atomically transfers the first/last element of a list to the first/last element of another list. |
| BLMOVE | ✓ | v2.6.0 | Blocks and then atomically transfers the first/last element of a list to the first/last element of another list. |
| LPOS | ✓ | v2.6.0 | Returns the index of the first matching element in a list. |
| LMPOP | ✓ | v2.6.0 | Removes and returns the first or last element(s) of a list. |
| BLMPOP | ✓ | v2.7.0 | Blocks and then removes and returns the first or last element(s) of a list. |
## Set commands
| Command | Supported OR Not | Since Version | Desc |
| ----------- | ---------------- | ------------- | ------------------------------------- |
| SADD | ✓ | v1.0.0 | Adds one or more members to a set. |
| SCARD | ✓ | v1.0.0 | Returns the number of members in a set. |
| SDIFF | ✓ | v1.0.0 | Returns the difference between sets. |
| SDIFFSTORE | ✓ | v1.0.0 | Stores the difference between sets in a destination set. |
| SINTER | ✓ | v1.0.0 | Returns the intersection of sets. |
| SINTERCARD | ✓ | v2.5.0 | Returns the cardinality (number of elements) in the intersection of sets. |
| SINTERSTORE | ✓ | v1.0.0 | Computes the intersection of multiple sets and stores the result in a destination set. |
| SISMEMBER | ✓ | v1.0.0 | Checks if a member is part of a set. |
| SMEMBERS | ✓ | v1.0.0 | Returns all the members in a set. |
| SMOVE | ✓ | v1.0.0 | Moves a member from one set to another. |
| SPOP | ✓ | v1.0.0 | Pop members in the order of keys |
| SRANDMEMBER | ✓ | v1.0.0 | Returns one or more random members from a set without removing them. (always first N members if not changed) |
| SREM | ✓ | v1.0.0 | Removes one or more members from a set. |
| SUNION | ✓ | v1.0.0 | Returns the union of multiple sets. |
| SUNIONSTORE | ✓ | v1.0.0 | Computes the union of multiple sets and stores the result in a destination set. |
| SSCAN | ✓ | v1.0.0 | Incrementally iterates over members of a set. |
## ZSet commands
| Command | Supported OR Not | Since Version | Description |
| ---------------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------- |
| BZMPOP | ✓ | v2.5.0 | Blocks until one or more elements are popped from one or more sorted sets. |
| BZPOPMIN | ✓ | v2.5.0 | Blocks until the element with the lowest score is popped from one or more sorted sets. |
| BZPOPMAX | ✓ | v2.5.0 | Blocks until the element with the highest score is popped from one or more sorted sets. |
| ZADD | ✓ | v1.0.0 | Adds one or more members to a sorted set, or updates the score of existing members. |
| ZCARD | ✓ | v1.0.0 | Returns the number of members in a sorted set. |
| ZCOUNT | ✓ | v1.0.0 | Counts the members in a sorted set with scores within a given range. |
| ZINCRBY | ✓ | v1.0.0 | Increments the score of a member in a sorted set. |
| ZINTERSTORE | ✓ | v1.0.0 | Computes the intersection of multiple sorted sets and stores the result in a destination sorted set. |
| ZLEXCOUNT | ✓ | v1.0.0 | Counts the members in a sorted set within a given lexicographical range. |
| ZMPOP | ✓ | v2.5.0 | Removes and returns one or more members with the lowest or highest scores from one or more sorted sets. |
| ZMSCORE | ✓ | v1.1.20 | Returns the scores of one or more members in a sorted set. (multi ZSCORE) |
| ZPOPMIN | ✓ | v1.0.0 | Removes and returns the member with the lowest score in a sorted set. |
| ZPOPMAX | ✓ | v1.0.0 | Removes and returns the member with the highest score in a sorted set. |
| ZRANGESTORE | ✓ | v2.5.0 | Stores a range of members from a sorted set into another sorted set. |
| ZRANGE | ✓ | v1.0.0 | Returns a range of members in a sorted set, by index. |
| ZRANGEBYLEX | ✓ | v1.0.0 | Returns a range of members in a sorted set, by lexicographical range. |
| ZRANGEBYSCORE | ✓ | v1.0.0 | Returns a range of members in a sorted set, by score. |
| ZRANK | ✓ | v1.0.0 | Determines the index of a member in a sorted set, based on score. |
| ZREM | ✓ | v1.0.0 | Removes one or more members from a sorted set. |
| ZREMRANGEBYLEX | ✓ | v1.0.0 | Removes all members in a sorted set within the given lexicographical range. |
| ZREMRANGEBYRANK | ✓ | v1.0.0 | Removes all members in a sorted set within the given index range. |
| ZREMRANGEBYSCORE | ✓ | v1.0.0 | Removes all members in a sorted set within the given score range. |
| ZREVRANK | ✓ | v1.0.0 | Determines the index of a member in a sorted set, in reverse order, based on score. |
| ZREVRANGE | ✓ | v1.0.0 | Returns a range of members in a sorted set, in reverse order, by index. |
| ZREVRANGEBYLEX | ✓ | v2.0.5 | Returns a range of members in a sorted set, in reverse order, by lexicographical range. |
| ZREVRANGEBYSCORE | ✓ | v1.0.0 | Returns a range of members in a sorted set, in reverse order, by score. |
| ZSCAN | ✓ | v1.0.0 | Incrementally iterates over elements in a sorted set. |
| ZSCORE | ✓ | v1.0.0 | Returns the score of a member in a sorted set. |
| ZUNION | ✓ | v2.5.0 | Returns the union of multiple sorted sets. |
| ZUNIONSTORE | ✓ | v1.0.0 | Computes the union of multiple sorted sets and stores the result in a destination sorted set. |
| ZINTER | ✓ | v2.8.0 | Returns the intersection of multiple sorted sets. |
| ZINTERCARD | ✓ | v2.8.0 | Computes the cardinality (number of elements) in the intersection of multiple sorted sets. |
| ZRANDMEMBER | ✓ | v2.8.0 | Returns one or more random members from a sorted set. |
## Key commands
| Command | Supported OR Not | Since Version | Desc |
| ----------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |
| DEL | ✓ | v1.0.0 | Deletes one or more keys. |
| EXISTS | ✓ | v1.0.0 | Checks if a key exists. |
| EXPIRE | ✓ | v1.0.0 | Sets a key's time to live in seconds. |
| EXPIREAT | ✓ | v1.0.0 | Sets a key's time to live based on a Unix timestamp. |
| EXPIRETIME | ✓ | v2.8.0 | Returns the expiration Unix timestamp of a key. |
| PEXPIRETIME | ✓ | v2.8.0 | Returns the expiration Unix timestamp of a key in milliseconds. |
| KEYS | ✓ | v1.0.0 | Returns all keys matching a pattern. |
| PERSIST | ✓ | v1.0.0 | Removes the expiration from a key. |
| PEXPIRE | ✓ | v1.0.0 | Sets a key's time to live in milliseconds. (Precision is in seconds if old encoding is used (see [#1033](https://github.com/apache/kvrocks/issues/1033))) |
| PEXPIREAT | ✓ | v1.0.0 | Sets a key's time to live based on a Unix timestamp in milliseconds. (Precision is in seconds if old encoding is used (see [#1033](https://github.com/apache/kvrocks/issues/1033))) |
| PTTL | ✓ | v1.0.0 | Returns the remaining time to live of a key in milliseconds. (precision is in seconds if old encoding is used (see [#1033](https://github.com/apache/kvrocks/issues/1033))) |
| TTL | ✓ | v1.0.0 | Returns the remaining time to live of a key in seconds. |
| TYPE | ✓ | v1.0.0 | Returns the data type of the value stored at a key. |
| SCAN | ✓ | v1.0.0 | Incrementally iterates over keys in the keyspace. |
| RENAME | ✓ | v2.8.0 | Renames a key. |
| RENAMENX | ✓ | v2.8.0 | Renames a key only if the new key does not exist. |
| RANDOMKEY | ✓ | v1.0.0 | Returns a random key from the keyspace. |
| UNLINK | ✓ | v2.1.0 | Asynchronously deletes a key (non-blocking). |
| MOVE | ✓ | v2.6.0 | Moves a key to another database. (If the key does not exist, the command returns 0, otherwise it will always return 1) |
| MOVEX | ✓ | v2.9.0 | Move a key between namespaces, see [#2225](https://github.com/apache/kvrocks/pull/2225) |
| COPY | ✓ | v2.9.0 | Copies a key to a new key. |
| SORT | ✓ | v2.9.0 | Sorts the elements in a list, set, or sorted set. |
## Bit commands
| Command | Supported OR Not | Since Version | Description |
| ----------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |
| GETBIT | ✓ | v1.0.0 | Returns the bit value at a specified offset in the string stored at a key. |
| SETBIT | ✓ | v1.0.0 | Sets or clears the bit at a specified offset in the string stored at a key. |
| BITCOUNT | ✓ | v1.0.0 | Counts the number of set bits (1s) in a string. |
| BITPOS | ✓ | v1.0.0 | Returns the position of the first bit set to 1 or 0 in a string. |
| BITFIELD | ✓ | v2.7.0 | Performs arbitrary bitfield operations on string values. |
| BITFIELD_RO | ✓ | v2.8.0 | Reads the values of specific bit fields in a string without modifying them (read-only variant of BITFIELD). |
| BITOP | ✓ | v2.1.0 | Performs bitwise operations (AND, OR, XOR, NOT) on multiple keys containing string values and stores the result in a destination key. |
:::note
String and bitmap are different types in Kvrocks, so you _cannot_ do bit operations with string, and vice versa.
:::
## Script commands
| Command | Supported OR Not | Since Version | Description |
| ---------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
| EVAL | ✓ | v2.0.4 | Executes a Lua script server-side, accepting keys and arguments as parameters. |
| EVALSHA | ✓ | v2.0.4 | Executes a Lua script using its SHA1 hash, which is useful when the script is already cached on the server. |
| EVAL_RO | ✓ | v2.2.0 | Executes a Lua script server-side in read-only mode, allowing it in replica instances (similar to EVAL, but read-only). |
| EVALSHA_RO | ✓ | v2.2.0 | Executes a Lua script in read-only mode using its SHA1 hash (similar to EVALSHA, but read-only). |
| SCRIPT | ✓ | v2.0.4 | Manages the Redis script cache, with subcommands for loading, flushing, and checking for script existence. (SCRIPT KILL and DEBUG subcommand are not supported) |
## PubSub commands
| Command | Supported OR Not | Since Version | Description |
| ------------ | ---------------- | ------------- | ----------------------------------------------------------------------------------------------------------- |
| PSUBSCRIBE | ✓ | v1.0.0 | Subscribes to channels using pattern matching. Receives messages sent to channels that match the pattern. |
| PUBLISH | ✓ | v1.0.0 | Sends a message to a specific channel. |
| MPUBLISH | ✓ | v2.6.0 | Publishes messages to multiple channels at once. |
| PUBSUB | ✓ | v1.0.0 | Provides information about the current Pub/Sub system, including channels and subscriptions. |
| PUNSUBSCRIBE | ✓ | v1.0.0 | Unsubscribes from channels using pattern matching, stopping the receipt of messages. |
| SUBSCRIBE | ✓ | v1.0.0 | Subscribes to a specific channel to receive messages sent to that channel. |
| UNSUBSCRIBE | ✓ | v1.0.0 | Unsubscribes from one or more channels, stopping the receipt of messages. |
| SSUBSCRIBE | ✓ | v2.8.0 | Subscribes the client to the specified shard channels. |
| SUNSUBSCRIBE | ✓ | v2.8.0 | Unsubscribes the client from the specified shard channels. |
## Transaction commands
| Command | Supported OR Not | Since Version | Description |
| ------- | ---------------- | ------------- | ---------------------------------------------------------------------------------------------------------------- |
| MULTI | ✓ | v2.0.2 | Marks the start of a transaction block in Redis. |
| EXEC | ✓ | v2.0.2 | Executes all commands issued after a MULTI command in a transaction. |
| DISCARD | ✓ | v2.0.2 | Cancels a transaction block, discarding all queued commands. |
| WATCH | ✓ | v2.4.0 | Watches one or more keys for changes, allowing for conditional transactions. |
| UNWATCH | ✓ | v2.4.0 | Cancels the effect of all WATCH commands, making the transaction unconditional. |
## SortedInt commands
| Command | Supported OR Not | Since Version | Description |
| ----------------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------ |
| SICARD | ✓ | v1.0.2 | Returns the number of elements in a sorted integer set. (similar to SCARD) |
| SIADD | ✓ | v1.0.2 | Adds one or more integers to a sorted integer set. (like SADD, but members are integers) |
| SIREM | ✓ | v1.0.2 | Removes one or more integers from a sorted integer set. (like SREM, but members are integers) |
| SIRANGE | ✓ | v1.0.2 | Returns a range of elements from a sorted integer set by index.
(`SIRANGE key offset count cursor since_id`) |
| SIREVRANGE | ✓ | v1.0.2 | Returns a range of elements from a sorted integer set by index, in reverse order. (`SIREVRANGE key offset count cursor max_id`) |
| SIEXISTS | ✓ | v1.1.20 | Checks if an integer exists in a sorted integer set. (`SIEXISTS key member1 [member2 ...]`) |
| SIRANGEBYVALUE | ✓ | v1.1.31 | Returns elements in a sorted integer set within a specified range of values. (`SIRANGEBYVALUE key min max [LIMIT offset count]`) |
| SIREVRANGEBYVALUE | ✓ | v1.1.31 | Returns elements in a sorted integer set within a specified range of values, in reverse order. (`SIREVRANGEBYVALUE key max min [LIMIT offset count]`) |
## Cluster commands
| SUBCOMMAND | Supported OR Not | Since Version | Description |
| ---------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
| CLUSTER | ✓ | v2.0.2 | Provides a range of subcommands to manage and query a Redis Cluster. |
| CLUSTERX | ✓ | v2.0.2 | A specialized command set used for managing cluster topology in a controlled manner. |
| READONLY | ✓ | v2.9.0 | In a Redis Cluster, marks the client as read-only, allowing it to read data from replicas. |
| READWRITE | ✓ | v2.9.0 | Resets the client from read-only mode back to the default read-write mode. |
| ASKING | ✓ | v2.9.0 | Used during a manual resharding process to indicate that the client should accept redirection to a new master node without changing its hash slot mapping. |
### CLUSTER subcommands
These commands are subcommands for `CLUSTER`, using as `CLUSTER INFO` etc.
| SUBCOMMAND | Supported OR Not | Since Version | Description |
| ---------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
| INFO | ✓ | v2.0.2 | Provides information about the state of the cluster. |
| NODES | ✓ | v2.0.2 | Returns the current nodes and their status in the cluster. |
| SLOTS | ✓ | v2.0.2 | Lists all slots and their associated nodes. |
| KEYSLOT | ✓ | v2.0.2 | Returns the hash slot for a given key. |
| RESET | ✓ | v2.9.0 | Resets a node's cluster state, making it forget its cluster configuration. |
| REPLICAS | ✓ | v2.9.0 | Lists the replicas for a specific node in the cluster. |
### CLUSTERX subcommands
These commands are subcommands for `CLUSTERX`, using as `CLUSTERX VERSION` etc.
| SUBCOMMAND | Supported OR Not | Since Version | Description |
| ---------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
| VERSION | ✓ | v2.0.2 | Displays the version of the CLUSTERX command set or protocol. |
| SETNODEID | ✓ | v2.0.2 | Sets or updates the node ID in the cluster configuration. |
| SETNODES | ✓ | v2.0.2 | Configures the nodes in the cluster, often used for initializing or changing the cluster's topology. |
| SETSLOT | ✓ | v2.0.6 | Manages slot assignments, moving slots between nodes. |
| MIGRATE | ✓ | v2.0.6 | |
:::note
To guarantee the correctness of client SDK, we rename the `CLUSTER` command to `CLUSTERX` to prevent the topology can being modified casually, but we can still use the `CLUSTER` command to fetch the cluster topology information.
:::
## Server commands
| Command | Supported OR Not | Since Version | Description |
| ----------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------ |
| BGSAVE | ✓ | v1.0.0 | Initiates a background save of the dataset to disk. |
| LASTSAVE | ✓ | v2.6.0 | Returns the Unix timestamp of the last successful save to disk. |
| PING | ✓ | v1.0.0 | Checks if the server is alive, responding with "PONG." |
| SELECT | ✓ | v1.0.0 | simply returns OK. |
| ECHO | ✓ | v2.0.6 | Echoes back the input string, useful for testing. |
| MONITOR | ✓ | v1.0.0 | Streams every command processed by the server in real time. |
| SHUTDOWN | ✓ | v1.0.0 | Stops the server, optionally saving the dataset to disk. |
| INFO | ✓ | v1.0.0 | Provides detailed information about the server. |
| ROLE | ✓ | v1.1.30 | Displays the role of the instance (master, slave, etc.) |
| CONFIG | ✓ | v1.0.0 | Manages the server's configuration parameters. |
| DBSIZE | ✓ | v1.0.0 | Returns the number of keys in the currently selected database. |
| DISK | ✓ | v2.2.0 | `DISK USAGE user_key` to get the disk usage of the `user_key`, see [#874](https://github.com/apache/kvrocks/issues/874) |
| MEMORY | ✓ | v2.4.0 | MEMORY USAGE command is an alias to DISK USAGE command. |
| DEBUG | ✓ | v1.3.0 | A collection of debugging commands for developers and administrators. (Only DEBUG SLEEP is supported.) |
| NAMESPACE | ✓ | v1.0.0 | Used to manage namespaces. |
| FLUSHDB | ✓ | v1.0.0 | Removes all keys from the currently selected database. |
| FLUSHALL | ✓ | v1.0.0 | Removes all keys from all databases. |
| FLUSHBACKUP | ✓ | v1.3.1 | Flushes backup data. |
| COMMAND | ✓ | v2.0.1 | Returns details about available commands. |
| CLIENT | ✓ | v1.0.0 | Manages client connections and their settings. |
| AUTH | ✓ | v1.0.0 | Authenticates a client to the server with a password. |
| QUIT | ✓ | v1.0.0 | Closes the connection with the server. |
| SLAVEOF | ✓ | v1.0.0 | Configures the server to replicate from a specified master. |
| SLOWLOG | ✓ | v1.0.0 | Manages and retrieves the slow query log. |
| PERFLOG | ✓ | v1.0.0 | Manages performance logging. |
| HELLO | ✓ | v2.2.0 | Negotiates the protocol version with the server. |
| TIME | ✓ | v2.4.0 | Returns the current server time as a Unix timestamp and microseconds. |
| STATS | ✓ | v1.0.0 | Dump the RocksDB statistics in JSON format. |
| RESTORE | ✓ | v2.6.0 | Create the new key with Redis serialized value, now supports String/List/Hash/Set/ZSet data types |
| COMPACT | ✓ | v1.0.0 | Compacts database storage. (RocksDB) |
| RDB | ✓ | v2.7.0 | RDB LOAD command is used to load RocksDB file from local path into Kvrocks |
| DUMP | ✓ | v2.9.0 | Serializes a key and returns it to the client. |
:::note
The db size is updated async after execute `DBSIZE SCAN` command.
:::
## GEO commands
| Command | Supported OR Not | Since Version | Description |
| -------------------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------- |
| GEOADD | ✓ | v1.1.12 | Adds geospatial items (latitude, longitude, and member) to a geospatial index (a sorted set). |
| GEODIST | ✓ | v1.1.12 | Returns the distance between two members of a geospatial index. |
| GEOHASH | ✓ | v1.1.12 | Returns the Geohash representation of one or more members in a geospatial index. |
| GEOPOS | ✓ | v1.1.12 | Returns the longitude and latitude of one or more members in a geospatial index. |
| GEORADIUS | ✓ | v1.1.12 | Returns members of a geospatial index within a radius around a given point. |
| GEORADIUS_ro | ✓ | v1.1.12 | A read-only variant of GEORADIUS, for use with read replicas. |
| GEORADIUSBYMEMBER | ✓ | v1.1.12 | Returns members of a geospatial index within a radius around a member's location. |
| GEORADIUSBYMEMBER_ro | ✓ | v1.1.12 | A read-only variant of GEORADIUSBYMEMBER, for use with read replicas. |
| GEOSEARCH | ✓ | v2.6.0 | Performs more complex geospatial searches, supporting multiple criteria like bounding boxes and ordering by distance. |
| GEOSEARCHSTORE | ✓ | v2.6.0 | Stores the result of a GEOSEARCH query in a new key. |
## Stream commands
| Command | Supported OR Not | Since Version | Description |
| ---------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
| XADD | ✓ | v2.2.0 | Appends a new entry to a stream. |
| XDEL | ✓ | v2.2.0 | Removes one or more entries from a stream by ID. |
| XINFO | ✓ | v2.2.0 | Provides information about STREAM only. |
| XLEN | ✓ | v2.2.0 | Returns the number of entries in a stream. |
| XRANGE | ✓ | v2.2.0 | Returns a range of entries from a stream, within a specified ID range. |
| XREAD | ✓ | v2.2.0 | Reads entries from one or more streams. |
| XREVRANGE | ✓ | v2.2.0 | Returns a range of entries from a stream in reverse order. |
| XTRIM | ✓ | v2.2.0 | Trims a stream to a specified number of entries or to a maximum ID. |
| XCLAIM | ✓ | v2.10.0 | Changes the ownership of pending stream entries to a different consumer. |
| XAUTOCLAIM | ✓ | v2.10.0 | Automatically claims pending entries in a stream, returning them to a consumer. |
| XGROUP | ✓ | v2.10.0 | Manages consumer groups for streams. |
| XPENDING | ✓ | v2.10.0 | Shows information about pending entries in a stream for a specific consumer group. |
| XREADGROUP | ✓ | v2.10.0 | Reads entries from a stream as part of a consumer group. |
| XACK | ✓ | v2.10.0 | Acknowledges the processing of one or more entries in a stream. |
| XSETID | ✓ | v2.3.0 | Sets the last delivered ID of a stream to a specific value. |
## BloomFilter commands
| Command | Supported OR Not | Since Version | Description |
| ---------- | ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------- |
| BF.RESERVE | ✓ | v2.6.0 | Creates a new Bloom filter with specified parameters. |
| BF.ADD | ✓ | v2.6.0 | Adds an item to a Bloom filter. |
| BF.EXISTS | ✓ | v2.6.0 | Checks if an item may exist in the Bloom filter. |
| BF.CARD | ✓ | v2.6.0 | Returns the number of unique elements that were added to the filter. |
| BF.INFO | ✓ | v2.6.0 | Returns information about the Bloom filter's configuration and status. |
| BF.MADD | ✓ | v2.6.0 | Adds multiple items to a Bloom filter. |
| BF.INSERT | ✓ | v2.7.0 | Adds one or more items to a Bloom filter, with the option to create a filter if it doesn't exist. |
| BF.MEXISTS | ✓ | v2.6.0 | Checks if multiple items may exist in the Bloom filter. |
## Function commands
| Command | Supported OR Not | Since Version | Description |
| -------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------------------- |
| FUNCTION | ✓ | v2.7.0 | Manages functions in Redis, including loading, listing, and deleting functions. |
| FCALL | ✓ | v2.7.0 | Calls a function by its name with specified arguments, allowing for custom script execution. |
| FCALL_RO | ✓ | v2.7.0 | Calls a read-only function, ensuring it does not modify data, suitable for use in replicas. |
:::note
Currently only `LOAD`, `DELETE`, `LIST` subcommands are supported in `FUNCTION`.
In addition, `LISTFUNC` subcommand is added as an extension to list all functions and their libraries in which they are located.
:::
## JSON commands
| Command | Supported OR Not | Since Version | Description |
| -------------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------------- |
| JSON.ARRAPPEND | ✓ | v2.7.0 | Appends elements to a JSON array. |
| JSON.ARRINDEX | ✓ | v2.7.0 | Searches for the first occurrence of a value in a JSON array. |
| JSON.ARRINSERT | ✓ | v2.7.0 | Inserts an element into a JSON array at a specified index. |
| JSON.ARRLEN | ✓ | v2.7.0 | Returns the length of a JSON array. |
| JSON.ARRPOP | ✓ | v2.7.0 | Removes and returns an element from a JSON array by index. |
| JSON.ARRTRIM | ✓ | v2.7.0 | Trims a JSON array to the specified range. |
| JSON.CLEAR | ✓ | v2.7.0 | Clears the contents of a JSON object or array, leaving it empty. |
| JSON.DEL | ✓ | v2.7.0 | Deletes a JSON value. |
| JSON.FORGET | ✓ | v2.7.0 | Alias for `JSON.DEL`, removes a JSON key. |
| JSON.GET | ✓ | v2.7.0 | Retrieves a JSON value by key. |
| JSON.MERGE | ✓ | v2.7.0 | Merges two JSON documents into one. |
| JSON.MGET | ✓ | v2.8.0 | Retrieves JSON values from multiple keys. |
| JSON.MSET | ✓ | v2.9.0 | Sets JSON values at multiple keys. |
| JSON.NUMINCRBY | ✓ | v2.7.0 | Increments a numeric value in a JSON document. |
| JSON.NUMMULTBY | ✓ | v2.7.0 | Multiplies a numeric value in a JSON document. |
| JSON.OBJKEYS | ✓ | v2.7.0 | Returns the keys in a JSON object. |
| JSON.OBJLEN | ✓ | v2.7.0 | Returns the number of keys in a JSON object. |
| JSON.RESP | ✓ | v2.10.0 | Converts a JSON value to RESP (Redis Serialization Protocol) format. |
| JSON.SET | ✓ | v2.7.0 | Sets the value of a JSON key. |
| JSON.STRAPPEND | ✓ | v2.7.0 | Appends a string to a value in a JSON document. |
| JSON.STRLEN | ✓ | v2.7.0 | Returns the length of a string in a JSON document. |
| JSON.TOGGLE | ✓ | v2.7.0 | Toggles a boolean value in a JSON document. |
| JSON.TYPE | ✓ | v2.7.0 | Returns the type of a JSON value (e.g., object, array, string). |
| JSON.DEBUG | ✓ | v2.9.0 | Provides debugging information about a JSON value. (supported subcommands: MEMORY) |
## Search commands
| Command | Supported OR Not | Since Version | Description |
| -------------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------------- |
| FT.CREATE | ✓ | unstable | Creates a new full-text search index. |
| FT.DROPINDEX | ✓ | unstable | Deletes a full-text search index. |
| FT.INFO | ✓ | unstable | Provides information about a full-text search index. |
| FT._LIST | ✓ | unstable | Lists all available full-text search indexes. |
| FT.SEARCH | ✓ | unstable | Searches a full-text index for documents matching a query. |
| FT.SEARCHSQL | ✓ | unstable | Extension for SQL queries: `FT.SEARCHSQL <sql>` |
| FT.EXPLAIN | ✓ | unstable | Explains how a full-text search query is executed. |
| FT.EXPLAINSQL | ✓ | unstable | Extension for SQL queries: `FT.EXPLAINSQL <sql>` |
| FT.TAGVALS | ✓ | unstable | Returns all distinct tags in a tag index. |
## HyperLogLog commands
| Command | Supported OR Not | Since Version | Description |
| -------------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------------- |
| PFADD | ✓ | v2.10.0 | Adds elements to a HyperLogLog data structure. |
| PFCOUNT | ✓ | v2.10.0 | Returns the approximate cardinality (number of unique elements) in a HyperLogLog. |
| PFMERGE | ✓ | v2.10.0 | Merges multiple HyperLogLog structures into a single structure. |