| 1 | |
| 2 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
| 3 | <html> |
| 4 | <head> |
| 5 | <link type="text/css" rel="stylesheet" href="style.css" /> |
| 6 | </head> |
| 7 | <body> |
| 8 | <div id="page"> |
| 9 | |
| 10 | <div id='header'> |
| 11 | <a href="index.html"> |
| 12 | <img style="border:none" alt="Redis Documentation" src="redis.png"> |
| 13 | </a> |
| 14 | </div> |
| 15 | |
| 16 | <div id="pagecontent"> |
| 17 | <div class="index"> |
| 18 | <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. --> |
| 19 | <b>NonexistentCommands: Contents</b><br> <a href="#HGETSET">HGETSET</a><br> <a href="#SET with expire">SET with expire</a><br> <a href="#ZADDNX">ZADDNX</a> |
| 20 | </div> |
| 21 | |
| 22 | <h1 class="wikiname">NonexistentCommands</h1> |
| 23 | |
| 24 | <div class="summary"> |
| 25 | A list of commands that don't exist in Redis, but can be accomplished in a different way. |
| 26 | </div> |
| 27 | |
| 28 | <div class="narrow"> |
| 29 | |
| 30 | 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"> |
| 31 | WATCH foo |
| 32 | old_value = HGET foo field |
| 33 | MULTI |
| 34 | HSET foo field new_value |
| 35 | EXEC |
| 36 | </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"> |
| 37 | WATCH foo |
| 38 | score = ZSCORE foo bar |
| 39 | IF score != NIL |
| 40 | MULTI |
| 41 | ZADD foo 1 bar |
| 42 | EXEC |
| 43 | ENDIF |
| 44 | </pre> |
| 45 | </div> |
| 46 | |
| 47 | </div> |
| 48 | </div> |
| 49 | </body> |
| 50 | </html> |
| 51 | |