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


##########
src/types/json.h:
##########
@@ -134,6 +134,34 @@ struct JsonValue {
     return result_count;
   }
 
+  StatusOr<std::vector<ssize_t>> ArrIndex(std::string_view path, const 
jsoncons::json &needle, int start,
+                                          int end) const {
+    std::vector<ssize_t> result;
+    try {
+      jsoncons::jsonpath::json_query(value, path, [&](const std::string & 
/*path*/, const jsoncons::json &val) {
+        if (!val.is_array()) {
+          result.emplace_back(-2);

Review Comment:
   Could you declare some constants to state what these magic numbers `-1` and 
`-2` mean?



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