forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpika_command_docs.cc
10845 lines (10831 loc) · 639 KB
/
pika_command_docs.cc
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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) 2023-present, Qihoo, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#ifdef WITH_COMMAND_DOCS
# include "include/pika_admin.h"
# include <memory>
# include <string>
# include <unordered_map>
# include <unordered_set>
static CommandCmd::EncodablePtr operator""_RedisInt(unsigned long long value) {
return std::make_shared<CommandCmd::EncodableInt>(value);
}
static CommandCmd::EncodablePtr operator""_RedisString(const char* value, std::size_t length) {
return std::make_shared<CommandCmd::EncodableString>(std::string(value, length));
}
static CommandCmd::EncodablePtr operator""_RedisStatus(const char* value, std::size_t length) {
return std::make_shared<CommandCmd::EncodableStatus>(std::string(value, length));
}
static CommandCmd::EncodablePtr RedisMap(CommandCmd::EncodableMap::RedisMap values) {
return std::make_shared<CommandCmd::EncodableMap>(std::move(values));
}
static CommandCmd::EncodablePtr RedisSet(std::vector<CommandCmd::EncodablePtr> values) {
return std::make_shared<CommandCmd::EncodableSet>(std::move(values));
}
static CommandCmd::EncodablePtr RedisArray(std::vector<CommandCmd::EncodablePtr> values) {
return std::make_shared<CommandCmd::EncodableArray>(std::move(values));
}
const std::string CommandCmd::kPikaField{"pika"};
const CommandCmd::EncodablePtr CommandCmd::kNotSupportedLiteral = "当前还未支持"_RedisString;
const CommandCmd::EncodablePtr CommandCmd::kCompatibleLiteral =
"该接口完全支持,使用方式与redis没有任何区别"_RedisString;
const CommandCmd::EncodablePtr CommandCmd::kBitSpecLiteral =
"BIT操作:与Redis不同,Pika的bit操作范围为2^21, bitmap的最大值为256Kb。redis setbit 只是对key的value值更新。但是pika使用rocksdb作为存储引擎,rocksdb只会新写入数据并且只在compact的时候才从硬盘删除旧数据。如果pika的bit操作范围和redis一致都是2^32的话,那么有可能每次对同一个key setbit时,rocksdb都会存储一个512M大小的value。这会产生 严重的性能隐患。因此我们对pika的bit操作范围作了取舍。"_RedisString;
const CommandCmd::EncodablePtr CommandCmd::kHyperLogLiteral =
"50w以内误差均小于1%, 100w以内误差小于3%, 但付出了时间代价."_RedisString;
const CommandCmd::EncodablePtr CommandCmd::kPubSubLiteral = "暂不支持keyspace notifications"_RedisString;
const CommandCmd::EncodablePtr CommandCmd::kNotSupportedSpecialization = RedisMap({{kPikaField, kNotSupportedLiteral}});
const CommandCmd::EncodablePtr CommandCmd::kCompatibleSpecialization = RedisMap({{kPikaField, kCompatibleLiteral}});
const CommandCmd::EncodablePtr CommandCmd::kBitSpecialization = RedisMap({{kPikaField, kBitSpecLiteral}});
const CommandCmd::EncodablePtr CommandCmd::kHyperLogSpecialization = RedisMap({{kPikaField, kHyperLogLiteral}});
const CommandCmd::EncodablePtr CommandCmd::kPubSubSpecialization = RedisMap({{kPikaField, kPubSubLiteral}});
const std::unordered_map<std::string, CommandCmd::EncodablePtr> CommandCmd::kPikaSpecialization{
{"pexpire", RedisMap({{kPikaField, "无法精确到毫秒,底层会自动截断按秒级别进行处理"_RedisString}})},
{"pexpireat", RedisMap({{kPikaField, "无法精确到毫秒,底层会自动截断按秒级别进行处理"_RedisString}})},
{"scan",
RedisMap(
{{kPikaField,
"会顺序迭代当前db的快照,由于pika允许重名五次,所以scan有优先输出顺序,依次为:string -> hash -> list -> zset -> set"_RedisString}})},
{"type",
RedisMap(
{{kPikaField,
"另外由于pika允许重名五次,所以type有优先输出顺序,依次为:string -> hash -> list -> zset -> set,如果这个key在string中存在,那么只输出sting,如果不存在,那么则输出hash的,依次类推"_RedisString}})},
{"keys",
RedisMap(
{{kPikaField,
"KEYS命令支持参数支持扫描指定类型的数据,用法如 \"keys * [string, hash, list, zset, set]\""_RedisString}})},
{"bitop", kBitSpecialization},
{"getbit", kBitSpecialization},
{"setbit", kBitSpecialization},
{"hset", RedisMap({{kPikaField, "暂不支持单条命令设置多个field value,如有需求请用HMSET"_RedisString}})},
{"srandmember", RedisMap({{kPikaField, "时间复杂度O( n ),耗时较多"_RedisString}})},
{"zadd", RedisMap({{kPikaField, "的选项 [NX|XX] [CH] [INCR] 暂不支持"_RedisString}})},
{"pfadd", kHyperLogSpecialization},
{"pfcount", kHyperLogSpecialization},
{"pfmerge", kHyperLogSpecialization},
{"psubscribe", kPubSubSpecialization},
{"pubsub", kPubSubSpecialization},
{"publish", kPubSubSpecialization},
{"punsubscribe", kPubSubSpecialization},
{"subscribe", kPubSubSpecialization},
{"unsubscribe", kPubSubSpecialization},
{"info",
RedisMap(
{{kPikaField,
"info支持全部输出,也支持匹配形式的输出,例如可以通过info stats查看状态信息,需要注意的是key space与redis不同,pika对于key space的展示选择了分类型展示而非redis的分库展示(因为pika没有库),pika对于key space的统计是被动的,需要手动触发,然后pika会在后台进行统计,pika的key space统计是精确的。触发方式为执行:keyspace命令即可,然后pika会在后台统计,此时可以使用:keyspace readonly命令来进行查看,readonly参数可以避免反复进行统计,如果当前数据为0,则证明还在统计中"_RedisString}})},
{"client", RedisMap({{kPikaField,
"当前client命令支持client list及client kill,client list显示的内容少于redis"_RedisString}})},
{"select", RedisMap({{kPikaField, "该命令在3.1.0版前无任何效果,自3.1.0版开始与Redis一致"_RedisString}})},
{"ping", RedisMap({{kPikaField, "该命令仅支持无参数使用,即使用PING,客户端返回PONG"_RedisString}})},
{"type",
RedisMap(
{{kPikaField,
"pika不同类型的key name 是允许重复的,例如:string 类型里有 key1,hash list set zset类型可以同时存在 key1,在使用 type命令查询时,只能得到一个,如果要查询同一个 name 所有的类型,需要使用 ptype 命令查询"_RedisString}})},
};
const std::unordered_map<std::string, CommandCmd::EncodablePtr> CommandCmd::kCommandDocs{
{"zremrangebyscore",
RedisMap({
{"summary",
"Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed."_RedisString},
{"since", "1.2.0"_RedisString},
{"group", "sorted-set"_RedisString},
{"complexity",
"O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "min"_RedisString},
{"type", "double"_RedisString},
{"display_text", "min"_RedisString},
}),
RedisMap({
{"name", "max"_RedisString},
{"type", "double"_RedisString},
{"display_text", "max"_RedisString},
}),
})},
})},
{"sunion", RedisMap({
{"summary", "Returns the union of multiple sets."_RedisString},
{"since", "1.0.0"_RedisString},
{"group", "set"_RedisString},
{"complexity", "O(N) where N is the total number of elements in all given sets."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
{"flags", RedisArray({
"multiple"_RedisStatus,
})},
}),
})},
})},
{"debug", RedisMap({
{"summary", "A container for debugging commands."_RedisString},
{"since", "1.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "Depends on subcommand."_RedisString},
{"doc_flags", RedisSet({
"syscmd"_RedisStatus,
})},
})},
{"readonly",
RedisMap({
{"summary", "Enables read-only queries for a connection to a Redis Cluster replica node."_RedisString},
{"since", "3.0.0"_RedisString},
{"group", "cluster"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"latency",
RedisMap({
{"summary", "A container for latency diagnostics commands."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "Depends on subcommand."_RedisString},
{"subcommands",
RedisMap({
{"latency|doctor", RedisMap({
{"summary", "Returns a human-readable latency analysis report."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"latency|help", RedisMap({
{"summary", "Returns helpful text about the different subcommands."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"latency|histogram",
RedisMap({
{"summary",
"Returns the cumulative distribution of latencies of a subset or all commands."_RedisString},
{"since", "7.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity",
"O(N) where N is the number of commands with latency information being retrieved."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "command"_RedisString},
{"type", "string"_RedisString},
{"display_text", "command"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
})},
}),
})},
})},
{"latency|history", RedisMap({
{"summary", "Returns timestamp-latency samples for an event."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "event"_RedisString},
{"type", "string"_RedisString},
{"display_text", "event"_RedisString},
}),
})},
})},
{"latency|graph", RedisMap({
{"summary", "Returns a latency graph for an event."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "event"_RedisString},
{"type", "string"_RedisString},
{"display_text", "event"_RedisString},
}),
})},
})},
{"latency|latest", RedisMap({
{"summary", "Returns the latest latency samples for all events."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"latency|reset", RedisMap({
{"summary", "Resets the latency data for one or more events."_RedisString},
{"since", "2.8.13"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "event"_RedisString},
{"type", "string"_RedisString},
{"display_text", "event"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
})},
}),
})},
})},
})},
})},
{"setbit",
RedisMap({
{"summary",
"Sets or clears the bit at offset of the string value. Creates the key if it doesn't exist."_RedisString},
{"since", "2.2.0"_RedisString},
{"group", "bitmap"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "offset"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "offset"_RedisString},
}),
RedisMap({
{"name", "value"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "value"_RedisString},
}),
})},
})},
{"lpush",
RedisMap({
{"summary", "Prepends one or more elements to a list. Creates the key if it doesn't exist."_RedisString},
{"since", "1.0.0"_RedisString},
{"group", "list"_RedisString},
{"complexity",
"O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments."_RedisString},
{"history", RedisSet({
RedisArray({"2.4.0"_RedisString, "Accepts multiple `element` arguments."_RedisString}),
})},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "element"_RedisString},
{"type", "string"_RedisString},
{"display_text", "element"_RedisString},
{"flags", RedisArray({
"multiple"_RedisStatus,
})},
}),
})},
})},
{"punsubscribe",
RedisMap({
{"summary", "Stops listening to messages published to channels that match one or more patterns."_RedisString},
{"since", "2.0.0"_RedisString},
{"group", "pubsub"_RedisString},
{"complexity",
"O(N+M) where N is the number of patterns the client is already subscribed and M is the number of total patterns subscribed in the system (by any client)."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "pattern"_RedisString},
{"type", "pattern"_RedisString},
{"display_text", "pattern"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
})},
}),
})},
})},
{"role", RedisMap({
{"summary", "Returns the replication role."_RedisString},
{"since", "2.8.12"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"lmove",
RedisMap({
{"summary",
"Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved."_RedisString},
{"since", "6.2.0"_RedisString},
{"group", "list"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "source"_RedisString},
{"type", "key"_RedisString},
{"display_text", "source"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "destination"_RedisString},
{"type", "key"_RedisString},
{"display_text", "destination"_RedisString},
{"key_spec_index", 1_RedisInt},
}),
RedisMap({
{"name", "wherefrom"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "left"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "left"_RedisString},
{"token", "LEFT"_RedisString},
}),
RedisMap({
{"name", "right"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "right"_RedisString},
{"token", "RIGHT"_RedisString},
}),
})},
}),
RedisMap({
{"name", "whereto"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "left"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "left"_RedisString},
{"token", "LEFT"_RedisString},
}),
RedisMap({
{"name", "right"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "right"_RedisString},
{"token", "RIGHT"_RedisString},
}),
})},
}),
})},
})},
{"memory",
RedisMap({
{"summary", "A container for memory diagnostics commands."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "Depends on subcommand."_RedisString},
{"subcommands",
RedisMap({
{"memory|doctor", RedisMap({
{"summary", "Outputs a memory problems report."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"memory|malloc-stats",
RedisMap({
{"summary", "Returns the allocator statistics."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "Depends on how much memory is allocated, could be slow"_RedisString},
})},
{"memory|help", RedisMap({
{"summary", "Returns helpful text about the different subcommands."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"memory|purge", RedisMap({
{"summary", "Asks the allocator to release memory."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "Depends on how much memory is allocated, could be slow"_RedisString},
})},
{"memory|stats", RedisMap({
{"summary", "Returns details about memory usage."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"memory|usage", RedisMap({
{"summary", "Estimates the memory usage of a key."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(N) where N is the number of samples."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "count"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "count"_RedisString},
{"token", "SAMPLES"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
}),
})},
})},
})},
})},
{"time", RedisMap({
{"summary", "Returns the server time."_RedisString},
{"since", "2.6.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"sunsubscribe",
RedisMap({
{"summary", "Stops listening to messages posted to shard channels."_RedisString},
{"since", "7.0.0"_RedisString},
{"group", "pubsub"_RedisString},
{"complexity", "O(N) where N is the number of clients already subscribed to a shard channel."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "shardchannel"_RedisString},
{"type", "string"_RedisString},
{"display_text", "shardchannel"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
})},
}),
})},
})},
{"module",
RedisMap({
{"summary", "A container for module commands."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "Depends on subcommand."_RedisString},
{"subcommands",
RedisMap({
{"module|load", RedisMap({
{"summary", "Loads a module."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "path"_RedisString},
{"type", "string"_RedisString},
{"display_text", "path"_RedisString},
}),
RedisMap({
{"name", "arg"_RedisString},
{"type", "string"_RedisString},
{"display_text", "arg"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
})},
}),
})},
})},
{"module|loadex", RedisMap({
{"summary", "Loads a module using extended parameters."_RedisString},
{"since", "7.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "path"_RedisString},
{"type", "string"_RedisString},
{"display_text", "path"_RedisString},
}),
RedisMap({
{"name", "configs"_RedisString},
{"type", "block"_RedisString},
{"token", "CONFIG"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
"multiple_token"_RedisStatus,
})},
{"arguments", RedisArray({
RedisMap({
{"name", "name"_RedisString},
{"type", "string"_RedisString},
{"display_text", "name"_RedisString},
}),
RedisMap({
{"name", "value"_RedisString},
{"type", "string"_RedisString},
{"display_text", "value"_RedisString},
}),
})},
}),
RedisMap({
{"name", "args"_RedisString},
{"type", "string"_RedisString},
{"display_text", "args"_RedisString},
{"token", "ARGS"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
"multiple"_RedisStatus,
})},
}),
})},
})},
{"module|list", RedisMap({
{"summary", "Returns all loaded modules."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(N) where N is the number of loaded modules."_RedisString},
})},
{"module|help", RedisMap({
{"summary", "Returns helpful text about the different subcommands."_RedisString},
{"since", "5.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"module|unload", RedisMap({
{"summary", "Unloads a module."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "name"_RedisString},
{"type", "string"_RedisString},
{"display_text", "name"_RedisString},
}),
})},
})},
})},
})},
{"bzmpop",
RedisMap({
{"summary",
"Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped."_RedisString},
{"since", "7.0.0"_RedisString},
{"group", "sorted-set"_RedisString},
{"complexity",
"O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "timeout"_RedisString},
{"type", "double"_RedisString},
{"display_text", "timeout"_RedisString},
}),
RedisMap({
{"name", "numkeys"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "numkeys"_RedisString},
}),
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
{"flags", RedisArray({
"multiple"_RedisStatus,
})},
}),
RedisMap({
{"name", "where"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "min"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "min"_RedisString},
{"token", "MIN"_RedisString},
}),
RedisMap({
{"name", "max"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "max"_RedisString},
{"token", "MAX"_RedisString},
}),
})},
}),
RedisMap({
{"name", "count"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "count"_RedisString},
{"token", "COUNT"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
}),
})},
})},
{"readwrite",
RedisMap({
{"summary", "Enables read-write queries for a connection to a Reids Cluster replica node."_RedisString},
{"since", "3.0.0"_RedisString},
{"group", "cluster"_RedisString},
{"complexity", "O(1)"_RedisString},
})},
{"zadd",
RedisMap({
{"summary",
"Adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn't exist."_RedisString},
{"since", "1.2.0"_RedisString},
{"group", "sorted-set"_RedisString},
{"complexity",
"O(log(N)) for each item added, where N is the number of elements in the sorted set."_RedisString},
{"history",
RedisSet({
RedisArray({"2.4.0"_RedisString, "Accepts multiple elements."_RedisString}),
RedisArray({"3.0.2"_RedisString, "Added the `XX`, `NX`, `CH` and `INCR` options."_RedisString}),
RedisArray({"6.2.0"_RedisString, "Added the `GT` and `LT` options."_RedisString}),
})},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "condition"_RedisString},
{"type", "oneof"_RedisString},
{"since", "3.0.2"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
{"arguments", RedisArray({
RedisMap({
{"name", "nx"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "nx"_RedisString},
{"token", "NX"_RedisString},
}),
RedisMap({
{"name", "xx"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "xx"_RedisString},
{"token", "XX"_RedisString},
}),
})},
}),
RedisMap({
{"name", "comparison"_RedisString},
{"type", "oneof"_RedisString},
{"since", "6.2.0"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
{"arguments", RedisArray({
RedisMap({
{"name", "gt"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "gt"_RedisString},
{"token", "GT"_RedisString},
}),
RedisMap({
{"name", "lt"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "lt"_RedisString},
{"token", "LT"_RedisString},
}),
})},
}),
RedisMap({
{"name", "change"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "change"_RedisString},
{"token", "CH"_RedisString},
{"since", "3.0.2"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
}),
RedisMap({
{"name", "increment"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "increment"_RedisString},
{"token", "INCR"_RedisString},
{"since", "3.0.2"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
}),
RedisMap({
{"name", "data"_RedisString},
{"type", "block"_RedisString},
{"flags", RedisArray({
"multiple"_RedisStatus,
})},
{"arguments", RedisArray({
RedisMap({
{"name", "score"_RedisString},
{"type", "double"_RedisString},
{"display_text", "score"_RedisString},
}),
RedisMap({
{"name", "member"_RedisString},
{"type", "string"_RedisString},
{"display_text", "member"_RedisString},
}),
})},
}),
})},
})},
{"swapdb",
RedisMap({
{"summary", "Swaps two Redis databases."_RedisString},
{"since", "4.0.0"_RedisString},
{"group", "server"_RedisString},
{"complexity",
"O(N) where N is the count of clients watching or blocking on keys from both databases."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "index1"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "index1"_RedisString},
}),
RedisMap({
{"name", "index2"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "index2"_RedisString},
}),
})},
})},
{"incrby",
RedisMap({
{"summary",
"Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist."_RedisString},
{"since", "1.0.0"_RedisString},
{"group", "string"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "increment"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "increment"_RedisString},
}),
})},
})},
{"zscore", RedisMap({
{"summary", "Returns the score of a member in a sorted set."_RedisString},
{"since", "1.2.0"_RedisString},
{"group", "sorted-set"_RedisString},
{"complexity", "O(1)"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "member"_RedisString},
{"type", "string"_RedisString},
{"display_text", "member"_RedisString},
}),
})},
})},
{"spop",
RedisMap({
{"summary",
"Returns one or more random members from a set after removing them. Deletes the set if the last member was popped."_RedisString},
{"since", "1.0.0"_RedisString},
{"group", "set"_RedisString},
{"complexity",
"Without the count argument O(1), otherwise O(N) where N is the value of the passed count."_RedisString},
{"history", RedisSet({
RedisArray({"3.2.0"_RedisString, "Added the `count` argument."_RedisString}),
})},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "count"_RedisString},
{"type", "integer"_RedisString},
{"display_text", "count"_RedisString},
{"since", "3.2.0"_RedisString},
{"flags", RedisArray({
"optional"_RedisStatus,
})},
}),
})},
})},
{"mset", RedisMap({
{"summary", "Atomically creates or modifies the string values of one or more keys."_RedisString},
{"since", "1.0.1"_RedisString},
{"group", "string"_RedisString},
{"complexity", "O(N) where N is the number of keys to set."_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "data"_RedisString},
{"type", "block"_RedisString},
{"flags", RedisArray({
"multiple"_RedisStatus,
})},
{"arguments", RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "value"_RedisString},
{"type", "string"_RedisString},
{"display_text", "value"_RedisString},
}),
})},
}),
})},
})},
{"geosearch",
RedisMap({
{"summary", "Queries a geospatial index for members inside an area of a box or a circle."_RedisString},
{"since", "6.2.0"_RedisString},
{"group", "geo"_RedisString},
{"complexity",
"O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape"_RedisString},
{"history", RedisSet({
RedisArray({"7.0.0"_RedisString, "Added support for uppercase unit names."_RedisString}),
})},
{"arguments",
RedisArray({
RedisMap({
{"name", "key"_RedisString},
{"type", "key"_RedisString},
{"display_text", "key"_RedisString},
{"key_spec_index", 0_RedisInt},
}),
RedisMap({
{"name", "from"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "member"_RedisString},
{"type", "string"_RedisString},
{"display_text", "member"_RedisString},
{"token", "FROMMEMBER"_RedisString},
}),
RedisMap({
{"name", "fromlonlat"_RedisString},
{"type", "block"_RedisString},
{"token", "FROMLONLAT"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "longitude"_RedisString},
{"type", "double"_RedisString},
{"display_text", "longitude"_RedisString},
}),
RedisMap({
{"name", "latitude"_RedisString},
{"type", "double"_RedisString},
{"display_text", "latitude"_RedisString},
}),
})},
}),
})},
}),
RedisMap({
{"name", "by"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "circle"_RedisString},
{"type", "block"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "radius"_RedisString},
{"type", "double"_RedisString},
{"display_text", "radius"_RedisString},
{"token", "BYRADIUS"_RedisString},
}),
RedisMap({
{"name", "unit"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "m"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "m"_RedisString},
{"token", "M"_RedisString},
}),
RedisMap({
{"name", "km"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "km"_RedisString},
{"token", "KM"_RedisString},
}),
RedisMap({
{"name", "ft"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "ft"_RedisString},
{"token", "FT"_RedisString},
}),
RedisMap({
{"name", "mi"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "mi"_RedisString},
{"token", "MI"_RedisString},
}),
})},
}),
})},
}),
RedisMap({
{"name", "box"_RedisString},
{"type", "block"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "width"_RedisString},
{"type", "double"_RedisString},
{"display_text", "width"_RedisString},
{"token", "BYBOX"_RedisString},
}),
RedisMap({
{"name", "height"_RedisString},
{"type", "double"_RedisString},
{"display_text", "height"_RedisString},
}),
RedisMap({
{"name", "unit"_RedisString},
{"type", "oneof"_RedisString},
{"arguments", RedisArray({
RedisMap({
{"name", "m"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "m"_RedisString},
{"token", "M"_RedisString},
}),
RedisMap({
{"name", "km"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "km"_RedisString},
{"token", "KM"_RedisString},
}),
RedisMap({
{"name", "ft"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "ft"_RedisString},
{"token", "FT"_RedisString},
}),
RedisMap({
{"name", "mi"_RedisString},
{"type", "pure-token"_RedisString},
{"display_text", "mi"_RedisString},
{"token", "MI"_RedisString},
}),
})},