PragmaTwice commented on code in PR #1847:
URL: https://github.com/apache/kvrocks/pull/1847#discussion_r1367741127
##########
src/types/json.h:
##########
@@ -132,6 +132,44 @@ struct JsonValue {
return Status::OK();
}
+ Status Type(std::string_view path, std::vector<std::string> *types) const {
+ types->clear();
+ try {
+ jsoncons::jsonpath::json_query(value, path, [&types](const std::string &
/*path*/, const jsoncons::json &val) {
+ switch (val.type()) {
+ case jsoncons::json_type::null_value:
+ types->emplace_back("null");
+ break;
+ case jsoncons::json_type::bool_value:
+ types->emplace_back("boolean");
+ break;
+ case jsoncons::json_type::int64_value:
+ case jsoncons::json_type::uint64_value:
+ types->emplace_back("integer");
+ break;
+ case jsoncons::json_type::double_value:
+ types->emplace_back("number");
+ break;
+ case jsoncons::json_type::string_value:
Review Comment:
I think it is not a type in JSON documents.
##########
src/types/json.h:
##########
@@ -132,6 +132,44 @@ struct JsonValue {
return Status::OK();
}
+ Status Type(std::string_view path, std::vector<std::string> *types) const {
+ types->clear();
+ try {
+ jsoncons::jsonpath::json_query(value, path, [&types](const std::string &
/*path*/, const jsoncons::json &val) {
+ switch (val.type()) {
+ case jsoncons::json_type::null_value:
+ types->emplace_back("null");
+ break;
+ case jsoncons::json_type::bool_value:
+ types->emplace_back("boolean");
+ break;
+ case jsoncons::json_type::int64_value:
+ case jsoncons::json_type::uint64_value:
+ types->emplace_back("integer");
+ break;
+ case jsoncons::json_type::double_value:
+ types->emplace_back("number");
Review Comment:
ditto https://github.com/apache/kvrocks/pull/1847#discussion_r1367741127
--
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]