skyitachi commented on code in PR #1865:
URL: https://github.com/apache/kvrocks/pull/1865#discussion_r1379784465


##########
src/commands/cmd_json.cc:
##########
@@ -204,11 +205,59 @@ class CommandJsonArrLen : public Commander {
   }
 };
 
+class CommanderJsonArrIndex : public Commander {
+ public:
+  Status Execute(Server *svr, Connection *conn, std::string *output) override {
+    redis::Json json(svr->storage, conn->GetNamespace());
+
+    std::vector<ssize_t> result;
+    int start = -1;
+    int end = std::numeric_limits<int>::max();
+
+    if (args_.size() > 4) {
+      auto parse_start = ParseInt<int>(args_[4], 10);
+      if (parse_start.IsOK()) {
+        start = parse_start.GetValue();
+      } else {
+        return {Status::RedisParseErr, errValueNotInteger};
+      }
+    }
+    if (args_.size() > 5) {
+      auto parse_end = ParseInt<int>(args_[5], 10);
+      if (parse_end.IsOK()) {
+        end = parse_end.GetValue();
+      } else {
+        return {Status::RedisParseErr, errValueNotInteger};
+      }
+    }

Review Comment:
   ok, got it



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