Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
Extracting a data from json array by certain key in java script

I have a json array which im getting my react data from it, the json is like this:

 {
         "Folders": [
           {
             "name": "parent 2",
             "children": [        //this is children_1
                {
                  "name": "parent 2",
                  "id": "parent 2",
                  "children": []     //this is children_2
                 }
               ],
               "id": 1
            }
          ]
        }

lets say i have the key value of name inside children(children_1) and i want to get the rest of the data inside that children using the name that i have, is there a way to do that ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Look at jsonpath

so it will be

var json = require('jsonpath');
var names = jp.query(json, '$.Folders[*].children[*].children');

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!