PragmaTwice commented on code in PR #1875:
URL: https://github.com/apache/kvrocks/pull/1875#discussion_r1382333390
##########
src/commands/cmd_json.cc:
##########
@@ -189,6 +189,24 @@ class CommandJsonClear : public Commander {
}
};
+class CommandJsonToggle : public Commander {
+ public:
+ Status Execute(Server *svr, Connection *conn, std::string *output) override {
+ redis::Json json(svr->storage, conn->GetNamespace());
+
+ std::string path = (args_.size() > 2) ? args_[2] : "$";
+ auto s = json.Toggle(args_[1], path);
+
+ if (s.IsNotFound()) {
+ return Status::OK();
+ }
Review Comment:
You can add `*output = redis::NilString()` before returning, just like in
other commands.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]