jsonpath as key accessor
See original GitHub issueis it possible use jsonpath as key accessor? somethings like this:
{
"id" : $content.container[0].component[?(@.componentType==1)].id
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:15
Top Results From Across the Web
JSON Member Accessors
A member accessor specifies the JSON object keys whose values are to be returned. A $ represents the entire object and is optionally...
Read more >jsonpath - IBM
A member accessor that returns an object member with the specified key. If the key name is a named variable starting with $...
Read more >Accessing JSON value when key has special character
In an angular controller, I call this JSON object data.topalbums.album . Back in my HTML page, I'm trying to insert the last (3rd)...
Read more >12: 9.15. JSON Functions and Operators - PostgreSQL
The || operator concatenates two JSON objects by generating an object containing the union of their keys, taking the second object's value when...
Read more >JSON path: descendant accessor ..<key> - Modern SQL
JSON path : descendant accessor ..<key>. BigQuery Db2 (LUW) MariaDB MySQL Oracle DB PostgreSQL SQL Server SQLite 2005 2007 2009 2011 2013 2015...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I prefer the first option.
Reasoning:
component
, kind of existential. ("Is there an attribute namedcomponent
, yes or no ?)However, I also like the curly braces I mentioned. But, out of consistency that indexing and evaluation happen to be in square brackets, I vote for your first option, hanving an expression that produces true/false coated in-between
[?
and]
.Well, I didn’t understand the initial question, and I still don’t, so I can’t really answer it. What “JSON path expressions” are being asked for that the language doesn’t have?