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
1 answer

How to extract values from JSON using JSONPath expression

I have data in JSON format and it looks like this: { "book": [{ "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", …
0
votes
1 answer

Can I get more than just one key's value with JSONPath?

Here's a simplified (and syntactically not correct, because I stripped it) version of a JSON I'm currently dealing with: { "data": { "134001": { "id": 134001, "label": "Deutsche Telekom", "is_active": true, }, …
metawops
  • 347
  • 2
  • 10
0
votes
1 answer

JSONPath find in list

Let's say I have a JSON like this: { "roles": [ "role1", "role2", "super_role1", "super_role2" ] } And I want to filter with JSONPath to only match 'super*' and get a list with the matches: ["super_role1", "super_role2"] What…
Jeremy D
  • 1
  • 1
0
votes
2 answers

unable to get JSON elements inside nested array using jsonpath syntax

I am trying to get the departments id where location is USA in the following JSON { "datapoints": [{ "id": "default.1", "definedBy": "default/0.1", "featureValues": { "bui.displayname": "Health…
parlad
  • 1,143
  • 4
  • 23
  • 42
0
votes
1 answer

In JSONPath, how to find keys matching a 'non existing' filter?

Here is a json snippet containing a definition structure : { "Type": "page", "Label": "Test", "Children": { "crud": { "Type": "crud", "Datasource": "crud_data", "Children": { "level1": {}, "group": { …
Cristof
  • 26
  • 1
0
votes
1 answer

JSONPath expression to find books having author name

I have the following json: { "books": [ { "id": 1, "name": "República Brasileira. de Deodoro a Bolsonaro - 2° Edição", "writers": [ { "name": "Paulo Ghiraldelli…
user2919910
  • 575
  • 1
  • 7
  • 17
0
votes
0 answers

Cannot use 'in' operator to search for JSONPath Online Evaluator

Cannot use 'in' operator to search for JSONPath Online Evaluator. Can you you please help me why is throwing error message ? Is it syntax error ?
poovaraj
  • 609
  • 1
  • 6
  • 10
0
votes
1 answer

How can we get the last element of the filtered json records with json path

The data: { token : "xxxx" files: [ { id : 1, deleted: true }, { id : 2, deleted: false }, { id : 3, deleted: false } ] } I am using the json path $..files[?(@.deleted==false)].id It…
0
votes
1 answer

Can I use a jsonpath predicate in a filter?

I have a model with a JSONField and need to select just the objects that have a certain value somewhere nested in the jsonb. From the Django documentation I understand you can use contains but the Postgres @> operator for containment does not…
Chris Wesseling
  • 6,226
  • 2
  • 36
  • 72
0
votes
0 answers

Comma inside a Json Array( Getting this value , set a value using the json path)

"Message": { "Heading": { "ABC": { "sample": [ "465783", "647837" ], } }, I have this json sample to read and update…
0
votes
1 answer

Not able to filter out a value in jsonPath

I am working on JSONPath where I need to fetch a value for a particular country below is the given JSON. { "homeCountry": "USA", "internationalControlDetails": [ { "address": { "city": null, …
0
votes
1 answer

Extracting Json response using Json extractor on Jmeter

Is there's a way I could extract the highest id: "15" of bld-appliance-1 using Json Path expression. Currently if use this Json expression "[?(@.name == 'bld-appliance-1')]..id" it returns me 3 result. I'm also aware I could use Match No but my…
0
votes
0 answers

JSON Path expression to extract top level only

I have the following JSON: { "Results":[ { "PK":9, "Name":"Duty Rating", "Description":"Length of time motor may be run without stopping for a cooling period", "Active":true, "TrackHistory":false, …
Sunette
  • 41
  • 5
0
votes
1 answer

Option.SUPRESS_EXCEPTION Is not working - JsonPath 2.7.0 (or higher version)

I'm trying to suppress all the exceptions when evaluating a JSON path. but when I upgrade the JSON path lib to 2.7, it seems like it is not working as expected. For example: var node = objectMapper.readTree("{\"test\" : null}"); …
0
votes
1 answer

How to use multiple fields to evaluate a condition using JSONPath expresstion

I have a json of type: [{ "event": "click", "status": "success", "test": true } , { "event": "send", "status": "success", "test": true } , { "event": "checked", "status": "failure", "test": false }] I want…
sashmi
  • 97
  • 1
  • 2
  • 14