I can HGET mykey oldfield
and store value
in my application and do HSET newfield value
, how can I avoid copy my value just like RENAMENX key newkey
while using hash?
Thanks.
There is no specific command to do it, but you can use a server-side Lua script to execute the following operations atomically:
You will pay for only one roundtrip, and you can handle errors (when the new field does already exist).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With