valkey/doc/NonexistentCommands.html
2010-12-15 15:59:45 +01:00

52 lines
2.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div id="page">
<div id='header'>
<a href="index.html">
<img style="border:none" alt="Redis Documentation" src="redis.png">
</a>
</div>
<div id="pagecontent">
<div class="index">
<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
<b>NonexistentCommands: Contents</b><br>&nbsp;&nbsp;<a href="#HGETSET">HGETSET</a><br>&nbsp;&nbsp;<a href="#SET with expire">SET with expire</a><br>&nbsp;&nbsp;<a href="#ZADDNX">ZADDNX</a>
</div>
<h1 class="wikiname">NonexistentCommands</h1>
<div class="summary">
A list of commands that don't exist in Redis, but can be accomplished in a different way.
</div>
<div class="narrow">
This is a list of commands that don't exist in Redis, but can be accomplished in a different way, usually by means of <a href="MultiExecCommand.html">WATCH/MULTI/EXEC</a>.<br/><br/>For better performance, you can pipeline multiple commands.<h1><a name="HGETSET">HGETSET</a></h1><a href="GetsetCommand.html">GETSET</a> for Hashes.<br/><br/><pre class="codeblock python" name="code">
WATCH foo
old_value = HGET foo field
MULTI
HSET foo field new_value
EXEC
</pre><h1><a name="SET with expire">SET with expire</a></h1>See <a href="SetexCommand.html">SETEX</a>.<h1><a name="ZADDNX">ZADDNX</a></h1>Add an element to a sorted set, only if the element doesn't already exist (by default, <a href="ZaddCommand.html">ZADD</a> would update the element's score if it already exists). <a href="http://groups.google.com/group/redis-db/browse_thread/thread/fc4c79d72e5bd346/6cdc07ecc36b81e7" target="_blank">See thread</a>.<br/><br/><pre class="codeblock python python" name="code">
WATCH foo
score = ZSCORE foo bar
IF score != NIL
MULTI
ZADD foo 1 bar
EXEC
ENDIF
</pre>
</div>
</div>
</div>
</body>
</html>