-
Notifications
You must be signed in to change notification settings - Fork 25
Converting JsonValue to String #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do I understand correctly that you would like to read the value of JsonValue json = parser.parse(...);
Iterator<Map.Entry<String, JsonValue>> it = json.objectIterator();
Map.Entry<String, JsonValue> field1 = it.next();
System.out.println(field1.getValue().asString()); // this prints '{ "field2": "xx" }' |
yes, it looks like simdjson has implemented this capability,thanks |
for me
|
The snippet I provided in the previous comment was just to verify if I understand the issue correctly. I'm not saying that currently this line works according to the comment: System.out.println(field1.getValue().asString()); // this prints '{ "field2": "xx" }' |
gotcha. are there plans to make |
I think we can try to add it. However, I'm currently busy working on #35, so I can't promise when I'll be able to do that. |
I see. That would be wonderful if you could make it happen at some point. I'll be waiting for it :) |
hello @piotrrzysko. a gentle reminder that this feature still highly anticipated and appreciated :) |
I’m really interested in this project and was wondering if there’s been any progress on this issue or if someone is currently working on it. The ability to convert to a string would be extremely helpful. |
#63 hello,it may be work for you |
Just out of curiosity: why could this feature be useful? What are the use cases? |
hello,piotrrzysko,use cases can be found in #63 src/test/java/org/simdjson/demand/PathsBasedTest.java. ![]()
you can also specify the type of the value you want to parse. This is useful when you want to ensure that the value you are parsing is of a certain type, string type default if not assign.
it's important to note that when referring to array indices, they should be enclosed within square brackets []. If a map key contains square brackets, they need to be written twice as a backslash is used to escape them. ![]()
|
could be useful in http proxy like scenario where only some nested (no matter how they look) parts of the input got transferred down the path some ETL pipelines may work that way |
Simdjson cannot compress structures
for example json
{ "field1": { "field2": "xx" } }
I cannot get the compressed value for field1, value is { "field2": "xx" }
The text was updated successfully, but these errors were encountered: