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 Unit Tests
8 To compile, run unit tests and install use the commands:
17 By default unit tests and valgrind memory checking are enabled.
18 This requires `cpputest` and `valgrind` as additional dependencies.
19 Unit test memory checking can be disabled with the `configure` option
20 `--disable-unit-test-memcheck` and the unit tests can be completely disabled
21 with the `configure` option `--disable-unit-test`.
22 For example to compile and install with unit tests completely disabled
23 one would run the commands:
26 ./configure --disable-unit-test
33 ## SETIE key value oldvalue [expiration EX seconds|PX milliseconds]
35 Time complexity: O(1) + O(1)
37 Checks a String 'key' for 'oldvalue' equality and set key for 'value' with
45 redis> setie mykey "Hello again" "Hello"
48 redis> set mykey "Hello"
52 redis> setie mykey "Hello again" "Hello"
56 redis> setie mykey "Hello 2" "Hello"
60 redis> setie mykey "Hello 2" "Hello again" ex 100
68 ## SETNE key value oldvalue [expiration EX seconds|PX milliseconds]
70 Time complexity: O(1) + O(1)
72 Checks a String 'key' for 'oldvalue' not equality and set key for 'value' with optional expired.
79 redis> setne mykey "Hello again" "Hello"
83 redis> setne mykey "Hello 2" "Hello again"
85 redis> setne mykey "Hello 2" "Hello"
89 redis> setne mykey "Hello 3" "Hello" ex 100
99 Time complexity: O(1) + O(1)
101 Checks a String 'key' for 'oldvalue' equality and delete the key.
107 redis> set mykey "Hello"
111 redis> delie mykey "Hello again"
115 redis> delie mykey "Hello"
121 ## DELNE key oldvalue
123 Time complexity: O(1) + O(1)
125 Checks a String 'key' for 'oldvalue' not equality and delete the key.
131 redis> set mykey "Hello"
135 redis> delne mykey "Hello"
139 redis> delne mykey "Hello again"
145 ## MSETPUB key value [key value...] channel message
147 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)
149 Set the given keys to their respective values and post a message to the given channel
151 ## MSETMPUB number_of_key_value_pairs number_of_channel_message_pairs key value [ key value ... ] channel message [ channel message ... ]
153 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)
155 Set the given keys to their respective values and post messages to their respective channels
157 ## SETXXPUB key value channel message [channel message...]
159 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).
161 Set key to hold string value if key already exists and post given messages to the corresponding channels if key value was set successfully
163 ## SETNXPUB key value channel message [channel message...]
165 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).
167 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
169 ## SETIEPUB key value oldvalue channel message [channel message...]
171 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).
173 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
175 ## SETNEPUB key value oldvalue channel message [channel message...]
177 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).
179 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
181 ## DELPUB key [key...] channel message
183 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)
185 Removes the specified keys and post a message to the given channel if delete key successfully(return >0)
187 ## DELMPUB number_of_keys number_of_channel_message_pairs key [ key ... ] channel message [ channel message ... ]
189 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)
191 Remove the specified keys. If any of the keys was deleted succesfully (delete return value > 0) then post given messages to the corresponding channels.
193 ## DELIEPUB key oldvalue channel message [channel message...]
195 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)
197 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.
199 ## DELNEPUB key oldvalue channel message [channel message...]
201 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)
203 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.
207 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
209 Returns all key-value pairs matching pattern.
217 redis> set mykey1 "myvalue1"
219 redis> set mykey2 "myvalue2"
221 redis> set mykey3 "myvalue3"
223 redis> set mykey4 "myvalue4"
238 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
240 Remove all key-value pairs matching pattern.