# CustomCommand section must be defined before Latency monitor to support all commands # # NOTE: only support maximum 16 custom commands # # [...] must be specify # (...) optional. it has default value # # CustomCommand [alias1] { ## module alias. just a delimter # [command1] { ## command string, must be lower case. i.e. setnx, expire, ... # (minArgs) (val) ## minimum arguments(including command itself). default is 2(key only) # (maxArgs) (val) ## maximum arguments(including command itself). default is 2(key only) # (mode) (val) ## a command mode Read/Write/Admin is exclusive. default is Write. # } # [command2] { # ... # } # ... # } # # default key position is first parameter. i.e. command1 key ... # if you want to use other position, add KeyAt2(key is second) or KeyAt3(key is third) to mode with '|' # i.e. mode Write|KeyAt2 # # in case of 'mode KeyAt2', it will resolved as Write|KeyAt2 # from redis source src/modules/hello.c CustomCommand hello { # hello.push.native key value hello.push.native { minArgs 3 maxArgs 3 mode Write } # hello.repl2 # just skipped since minArgs = 2, maxArgs = 2, mode = Write are default values hello.repl2 { } # hello.toggle.case key # same as hello.repl2 hello.toggle.case { } # hello.more.expire key milliseconds hello.more.expire { minArgs 3 maxArgs 3 } # hello.zsumrange key startscore endscore hello.zsumrange { minArgs 4 maxArgs 4 mode Read } # hello.lexrange key min_lex max_lex min_age max_age hello.lexrange { minArgs 6 maxArgs 6 mode Read } # hello.hcopy key srcfield dstfield hello.hcopy { minArgs 4 maxArgs 4 } } # from redis source src/modules/hellotype.c CustomCommand hellotype { # hellotype.insert key value hellotype.insert { minArgs 3 maxArgs 3 } # hellotype.range key first count hellotype.range { minArgs 4 maxArgs 4 mode Read } # hellotype.len key hello.len { mode Read } }