PragmaTwice commented on code in PR #1847:
URL: https://github.com/apache/kvrocks/pull/1847#discussion_r1367716526
##########
src/commands/cmd_json.cc:
##########
@@ -123,8 +123,32 @@ class CommandJsonArrAppend : public Commander {
}
};
+class CommandJsonType : public Commander {
+ public:
+ Status Execute(Server *svr, Connection *conn, std::string *output) override {
+ redis::Json json(svr->storage, conn->GetNamespace());
+
+ std::vector<std::string> types;
+
+ std::string path = "$";
+ if (args_.size() > 2) {
+ path = args_[2];
+ }
Review Comment:
```suggestion
if (args_.size() == 2) {
path = args_[2];
} else if (args_.size() > 2) {
return {Status::RedisExecErr, "The number of arguments is more than
expected"};
}
```
--
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]