Skip to content

Conversation

@neomantra
Copy link
Contributor

I made this relative to my CHOP work. If you prefer it to be based on current master, let me know.

CHOP key count

Removes characters from a value to a String key.
If 'count' is positive or zero, it removes from the right of the string;
if 'count' is negative, it removes from the left of the string.
If |count| is greater than the string length, the value is set as an empty string.
It is an error if the value is not a String.
Integer Reply: the length of the string after the chop operation.
Since Redis 4 was released without https://github.com/antirez/redis/pull/3718
this change was required to make CHOP work properly with Redis 4.0.0.

Now all tests pass on stock Redis 4.0.0.
Includes test and documentation.
@itamarhaber
Copy link
Contributor

So this relates to #10 - thanks for the contrib, will try to merge asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants