3 This subdirectory provides implementation for the commands which are implemented
4 as a [Redis modules](https://redis.io/topics/modules-intro).
6 # Compiling and UT (Unit Tests)
8 To compile and install run standard automake commands
9 in the redismodule directory:
17 To run unit tests `cpputest` and `valgrind`
18 need to be installed as additional dependencies.
19 To enable and run unit tests use the commands:
22 ./configure --enable-unit-test
28 ## SETIE key value oldvalue [expiration EX seconds|PX milliseconds]
30 Time complexity: O(1) + O(1)
32 Checks a String 'key' for 'oldvalue' equality and set key for 'value' with
40 redis> setie mykey "Hello again" "Hello"
43 redis> set mykey "Hello"
47 redis> setie mykey "Hello again" "Hello"
51 redis> setie mykey "Hello 2" "Hello"
55 redis> setie mykey "Hello 2" "Hello again" ex 100
63 ## SETNE key value oldvalue [expiration EX seconds|PX milliseconds]
65 Time complexity: O(1) + O(1)
67 Checks a String 'key' for 'oldvalue' not equality and set key for 'value' with optional expired.
74 redis> setne mykey "Hello again" "Hello"
78 redis> setne mykey "Hello 2" "Hello again"
80 redis> setne mykey "Hello 2" "Hello"
84 redis> setne mykey "Hello 3" "Hello" ex 100
94 Time complexity: O(1) + O(1)
96 Checks a String 'key' for 'oldvalue' equality and delete the key.
102 redis> set mykey "Hello"
106 redis> delie mykey "Hello again"
110 redis> delie mykey "Hello"
116 ## DELNE key oldvalue
118 Time complexity: O(1) + O(1)
120 Checks a String 'key' for 'oldvalue' not equality and delete the key.
126 redis> set mykey "Hello"
130 redis> delne mykey "Hello"
134 redis> delne mykey "Hello again"
140 ## MSETPUB key value [key value...] channel message
142 Time complexity: O(N) where N is the number of keys to set + O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client)
144 Set the given keys to their respective values and post a message to the given channel
146 ## MSETMPUB number_of_key_value_pairs number_of_channel_message_pairs key value [ key value ... ] channel message [ channel message ... ]
148 Time complexity: O(N) where N is the number of keys to set + O(N_1+M) [ + O(N_2+M) + ... ] where N_i are the number of clients subscribed to the corresponding receiving channel and M is the total number of subscribed patterns (by any client)
150 Set the given keys to their respective values and post messages to their respective channels
152 ## SETXXPUB key value channel message [channel message...]
154 Time complexity: O(1) + O(1) + O(N_1+M) [ + O(N_2+M) + ... ] where N_i are the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
156 Set key to hold string value if key already exists and post given messages to the corresponding channels if key value was set successfully
158 ## SETNXPUB key value channel message [channel message...]
160 Time complexity: O(1) + O(1) + O(N_1+M) [ + O(N_2+M) + ... ] where N_i are the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
162 Set key to hold string value if key does not exist and post given messages to the corresponding channels if key value was set successfully
164 ## SETIEPUB key value oldvalue channel message [channel message...]
166 Time complexity: O(1) + O(1) + O(1) + O(N_1+M) [ + O(N_2+M) + ... ] where N_i are the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
168 If the string corresponding to 'key' is equal to 'oldvalue' then set key for 'value' and post given messages to the corresponding channels if key value was set successfully
170 ## SETNEPUB key value oldvalue channel message [channel message...]
172 Time complexity: O(1) + O(1) + O(1) + O(N_1+M) [ + O(N_2+M) + ... ] where N_i are the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client).
174 If the string corresponding to 'key' is not equal to 'oldvalue' then set key for 'value' and post given messages to the corresponding channels if key value was set successfully
176 ## DELPUB key [key...] channel message
178 Time complexity: O(N) where N is the number of keys that will be removed + O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client)
180 Removes the specified keys and post a message to the given channel if delete key successfully(return >0)
182 ## DELMPUB number_of_keys number_of_channel_message_pairs key [ key ... ] channel message [ channel message ... ]
184 Time complexity: O(N) where N is the number of keys that will be removed + O(N_1+M) [ + O(N_2+M) + ... ] where N_i are the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client)
186 Remove the specified keys. If any of the keys was deleted succesfully (delete return value > 0) then post given messages to the corresponding channels.
188 ## DELIEPUB key oldvalue channel message [channel message...]
190 Time complexity: O(1) + O(1) + O(1) + O(N_1+M) [ + O(N_2+M) + ...] where N_i are the number of clients subscribed to the corrensponding receiving channel and M is the total number of subscribed patterns (by any client)
192 If the string corresponding to 'key' is equal to 'oldvalue' then delete the key. If deletion was succesful (delete return value was 1) then post given messages to the corresponding channels.
194 ## DELNEPUB key oldvalue channel message [channel message...]
196 Time complexity: O(1) + O(1) + O(1) + O(N_1+M) [ + O(N_2+M) + ...] where N_i are the number of clients subscribed to the corrensponding receiving channel and M is the total number of subscribed patterns (by any client)
198 If the string corresponding to 'key' is not equal to 'oldvalue' then delete the key. If deletion was succesful (delete return value was 1) then post given messages to the corresponding channels.
202 Time complexity: O(N) with N being the number of keys in the instance + O(N) where N is the number of keys to retrieve
204 Returns all key-value pairs matching pattern.
212 redis> set mykey1 "myvalue1"
214 redis> set mykey2 "myvalue2"
216 redis> set mykey3 "myvalue3"
218 redis> set mykey4 "myvalue4"
233 Time complexity: O(N) with N being the number of keys in the instance + O(N) where N is the number of keys that will be removed
235 Remove all key-value pairs matching pattern.