You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "torwig (via GitHub)" <gi...@apache.org> on 2025/03/07 08:00:40 UTC
Re: [PR] feat: Add DELPREFIX to delete keys by prefix (#2628) [kvrocks]
torwig commented on code in PR #2819:
URL: https://github.com/apache/kvrocks/pull/2819#discussion_r1984615419
##########
src/commands/cmd_key.cc:
##########
@@ -336,6 +336,30 @@ class CommandPersist : public Commander {
}
};
+class CommandDelPrefix : public Commander {
+ public:
+ Status Execute(engine::Context &ctx, Server *srv, Connection *conn, std::string *output) override {
+ if (args_.size() != 2) {
+ return {Status::RedisParseErr, "wrong number of arguments for 'DELPREFIX' command"};
+ }
+
+ std::string prefix = args_[1];
+ auto storage = srv->storage;
+ std::string start_key = prefix;
+ std::string end_key = prefix;
+ end_key.back()++;
Review Comment:
Maybe I forgot something about C++, but could you please explain what the goal of this line is?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org