Questions tagged [json-path-expression]

A JSON path expression is an expression, possibly in a domain-specific language, specifying a path to to one or more values within a JSON text. The expression may include filters.

Javascript provides a well-known notation for JSON path expressions. JSONPath and JMSEPath are well-known DSLs for JSON path expressions. In jq, any JSON array consisting solely of strings and/or integers can be used as a path expression.

179 questions
0
votes
0 answers

jsonpath to extract value in array, keeping the same structure by returning list of list

I want to find the jsonpath expression for extracting value in arrays, without flattening. For example, here's the json [ { "id": "1", "label": [ { "id": "1.1", "tag": "tag1.1" …
Kleenex
  • 75
  • 1
  • 2
  • 7
0
votes
1 answer

JSON Extract Nested Associative Arrays into Rows in MySQL 8 using JSON_TABLE

I have my data setup in mysql table in a json column that has nested rows with unique key for each child array. I am using MySQL 8 and tried using json_table function but with no success. Here is the sample structure and data of my table: CREATE…
Naveen Chand K
  • 411
  • 1
  • 5
  • 13
0
votes
1 answer

Filter and output values in JSONPath Expression that begins with given characters

I have a JSON that structured as below. I am using JSONPath Expression to filter values only. How does one filter and output only those values where the first three characters of those values match with a given three characters. [ { …
Naveen Chand K
  • 411
  • 1
  • 5
  • 13
0
votes
1 answer

JAVA JsonPath get selected paths using regex

Given the following Json { "id":"MENU_FULL_V2", "version":"MENU_FULL_V2", "type":"MAIN", "icon":"shopping-bag-r", "description":"This is the description {$.description}", "order":15000, "code":"code", …
Kevin Valdez
  • 359
  • 4
  • 17
0
votes
0 answers

What is JSON exporter YAML configuration that searches for a keyword in a string array and returns a value of 1 if it exists and 0 if it doen't exist?

I wanted to write a JSON exporter yml config that generate metrics from a URL response when 'Search' keyword present in the 'node_types' string array. (response JSON mentioned below). Expected Metrics from JSON exporter…
Vinod
  • 1
  • 1
0
votes
1 answer

JSONPath concat arrays and joing

I am trying to use JSONPath expression to extract 2 arrays and concatenate them today to form a long array - and ideally making them unique. However, no syntax I use in the online playground produces results. Ultimately I will want to use this in a…
Christian Bongiorno
  • 5,150
  • 3
  • 38
  • 76
0
votes
0 answers

How to remove common elements from two array using Jway Json Path

Below is the input JSON array and I'm expecting non identical object which is not present in the second array in the output. JSON Path version I'm using: 2.7.0 { "first": [ { "id": "1" }, { "id":…
0
votes
1 answer

JSONPath Expression to return objects within an array based on value of a key

I have a JSON Array which contains multiple JSON objects: [ { "s3_uri":"s3://fake-s3-bucket/fact_table/fact_table.csv", "dataset":"fact_table" }, { "s3_uri":"s3://fake-s3-bucket/dimension_table/dimension_table.csv", …
Geocoder
  • 123
  • 2
  • 8
0
votes
1 answer

Get JSON tree based on the JSON paths list Java

My input is something like: List.of("customer.name", "customer.phone", "shop.address", "nr") And I have to get the JSON tree hierarchy like: { customer: { name: "", phone: "", }, shop: { address: "" }, nr: "" } I am using…
0
votes
0 answers

JsonPath filter IN Operator not working as expected for of Array

I have this Json object as example which I tried to query using JsonPath expression. { "values": [ { "attributes": null, "label": "Label1", "validFor": [ 1,2 ], "value": "Value1" }, { …
0
votes
1 answer

JSONPath and regex: filter to search end substring

I need to extract "https://www.domain3.com" from this JSON { "jobs": [ { "name": "alfa", "url": "https://www.domain1.com" }, { "name": "beta_publish", "url":…
Cesare
  • 1,629
  • 9
  • 30
  • 72
0
votes
0 answers

Code completion with antlr4-c3: getting recursive scope

I am trying to use the code completion with antlr4-c3. Suppose that the list of suggestions for the function argument depends on the function's name. So for the following expression foo(bar(...)) I want to get a list of ["foo", "bar"] so that I can…
0
votes
1 answer

How to find the parent keys of a jsonpath result

I have this json obj { "abc": { "some_field": { "title": "Token", "type": "password" }, "some_field_2": { "title": "Domain", "type": "text" }, "some_field_3": { "title": "token2", "type":…
George Pamfilis
  • 1,397
  • 2
  • 19
  • 37
0
votes
1 answer

Json query that returns parent element and child data with condition?

I've this JSON (I know it's not a very conventional JSON ;) ) { "2958114":{"stockOnline": 305 }, "2958113": {"stockOnline": 2}, "2958115": {"stockOnline": 0} } I want to extract all line with stockOnline attribute <> 0 with a JSON…
gozen59
  • 3
  • 1
0
votes
1 answer

How to retrieve responses that are an array in JSON Path

I have the following API specification in JSON format. I want to retrieve, using JSON path, those responses (200, 401, etc.) that return directly an array as a response. That is, [{}, {}, ...] instead of {result: [{}, {}, ...]}. What I have been…
Antonio Gamiz Delgado
  • 1,871
  • 1
  • 12
  • 33