Returns | New value of the counter if found, otherwise nil |
---|---|
Keys |
|
Args |
|
> evalsha f74dd5c086898b8a3d69655334b94fa7e006a9b1 1 activeusers 1 (nil) > set activeusers 0 OK > evalsha f74dd5c086898b8a3d69655334b94fa7e006a9b1 1 activeusers 1 (integer) 1 > evalsha f74dd5c086898b8a3d69655334b94fa7e006a9b1 1 activeusers 2 (integer) 3
if redis.call("EXISTS",KEYS[1]) == 1 then return redis.call("INCRBY",KEYS[1],ARGV[1]) else return nil end
f74dd5c086898b8a3d69655334b94fa7e006a9b1
← More scripts from the Memetria Library
All scripts on this site are in the public domain, unless otherwise noted, and are provided without warranty express or implied. Memetria make no claim for the effectiveness, safety, security or quality of the scripts contained within.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.