Hi there,
I want to execute the command (version 6.2):
SET mykey "Hello" NX GET
I get an error in response. Is this the expected behavior?
ERR syntax error
Comment From: sundb
nx and get cannot exist at the same time.
Comment From: oranagra
right. these two contradict each other. you can't ask for the value only if the key doesn't exist.
Comment From: andsens
@skylar I assume you want to set a key if it doesn't already exist and end up with whatever the value of the key is regardless of whether you managed to set it or not.
To that end you should use a transaction (MULTI).
Comment From: skylar
@sklyar