My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 377: [FEATURE REQUEST] An atomic command for replacing substrings. (SUBSTR_REPLACE)
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


Sign in to add a comment
 
Reported by nat...@nathanhammond.com, Nov 15, 2010
We have SET, APPEND, and SUBSTR. Considering the similarities between these, and the fact that APPEND can be done atomically, how about an atomic command for SUBSTR_REPLACE?

The format would be:
SUBSTR_REPLACE key start end replace

Interaction would be:
redis> set s "This is a string."
OK
redis> substr s 0 3 "Rope"
"Rope is a string."
redis> substr s 0 -1 "New content."
"New content."

etc.

The second scenario is an alias for set, and there are versions that would be an alias for prepend and append.

Is there anything to prevent this?

(I don't care what the command name would end up being, I just made something up.)
Sign in to add a comment

Powered by Google Project Hosting