jackyyyyyssss commented on code in PR #2323:
URL: https://github.com/apache/kvrocks/pull/2323#discussion_r1607957334
##########
src/types/json.h:
##########
@@ -217,6 +217,25 @@ struct JsonValue {
return results;
}
+ StatusOr<Optionals<uint64_t>> StrBytes(std::string_view path) const {
+ Optionals<uint64_t> results;
+ try {
+ jsoncons::jsonpath::json_query(
+ value, path, [&results](const std::string & /*path*/, const
jsoncons::json &origin) {
+ if (!origin.empty()) {
+ // This is only a rough calculation of the size of the string
size char, not the entire byte occupied by
+ // the object
+ results.emplace_back(origin.as_string().size() *
sizeof(std::string::value_type));
Review Comment:
If multiple elements are hit, an array is returned. This is the return value
of Redis 7.0
<img width="453" alt="251ef557533affef376c009aaf4d218"
src="https://github.com/apache/kvrocks/assets/127465317/0461b0fc-fc59-49ec-b418-bfd2029d6826">
--
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]