You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thank you for this awesome project! I am trying to implement this in one of our libraries to get values from nested objects. The problem is our json structure is not known, but the key names will always be the same. For example
Is there a way for me to get the values for the count and cost keys in each top level key us-west-2 and us-east-1. The problem is the json structure is dynamic, in some cases we'll have only us-west-2 in other cases there'll be no us-west-2 and many other values and similar for the nested keys as well. The only thing common will be
"cost": "float",
"type": "string",
"count": "int"
Thank you!
The text was updated successfully, but these errors were encountered:
@shabbskagalwala
In recent gjson versions (I think since v1.16.0) there is the new @dig modifier (see SYNTAX.md#modifiers ) that combined with multipaths could be used for example like this:
{"count":@dig:count,"cost":@dig:cost}
to get (I've pretty-fied the output for easier readability):
First of all thank you for this awesome project! I am trying to implement this in one of our libraries to get values from nested objects. The problem is our json structure is not known, but the key names will always be the same. For example
Is there a way for me to get the values for the
count
andcost
keys in each top level keyus-west-2
andus-east-1
. The problem is the json structure is dynamic, in some cases we'll have onlyus-west-2
in other cases there'll be nous-west-2
and many other values and similar for the nested keys as well. The only thing common will beThank you!
The text was updated successfully, but these errors were encountered: