Answer the question
In order to leave comments, you need to log in
How to make a jsonpath request?
var cities = [
{ name: "London", "population": 8615246 },
{ name: "Berlin", "population": 3517424 },
{ name: "Madrid", "population": 3165235 },
{ name: "Rome", "population": 2870528 }
];
var jp = jsonpath; // для краткости
var names = jp.query(cities, '$..name');
console.log(names); // [ "London", "Berlin", "Madrid", "Rome" ]
Answer the question
In order to leave comments, you need to log in
$[?(@.population == 2870528)].name
You can try at jsonpath.com
See query language . Filter?( условие )
json
{
"cities": [
{ "name": "London", "population": 8615246 },
{ "name": "Berlin", "population": 3517424 },
{ "name": "Madrid", "population": 3165235 },
{ "name": "Rome", "population": 2870528 }
]
}
[
{
"name": "London",
"population": 8615246
}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question