git-hulk commented on code in PR #1856:
URL: https://github.com/apache/kvrocks/pull/1856#discussion_r1371478179


##########
src/commands/cmd_json.cc:
##########
@@ -171,10 +171,42 @@ class CommandJsonClear : public Commander {
   }
 };
 
+class CommandJsonArrLen : public Commander {
+ public:
+  Status Execute(Server *svr, Connection *conn, std::string *output) override {
+    redis::Json json(svr->storage, conn->GetNamespace());
+
+    std::string path = "$";
+    if (args_.size() == 3) {
+      path = args_[2];
+    } else if (args_.size() > 3) {
+      return {Status::RedisExecErr, "The number of arguments is more than 
expected"};
+    }
+
+    std::vector<uint64_t> results;
+    auto s = json.ArrLen(args_[1], path, results);
+    if (!s.ok()) {

Review Comment:
   It should return nil if the key is not found



-- 
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]

Reply via email to