in Education by
i have a json structure like that, where i would like to take from the json path the "id", but when i run the JSON input method in pentaho, putting "$..id" as the path, it returns me two lines about the same person, one containing the first id and the second one containing the second id (from the "photo"). What type of path should i use to take just the first id? ("id":"63b81795-83f0-4ffc-8ec3-6acc0236fcb5") "profile": {"email":"[email protected]", "id":"63b81795-83f0-4ffc-8ec3-6acc0236fcb5", "mobile":"85985119032", "name":"João Luiz Sampaio da Silva" "photo":{"filename":"20210610_152453.jpg", "id":"cdee6e2a-5bf7-4957-b5ee-3a82e1fc9f55", "mimetype":"image/jpeg", "path":"individual/ebf08be7-dfc5-4e24-97c6-abe3e5b56342/document/0dc3f588-ef55-41d8-bc33-1c88d1542df8/cdee6e2a-5bf7-4957-b5ee-3a82e1fc9f55.jpg"}} JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
json path always returns data as an array,even if it is just one item, so you have to take the first element var id = jsonPath(profile , "$.profile.id")[0]; //63b81795-83f0-4ffc-8ec3-6acc0236fcb5 to get a nested id var id = jsonPath(profile , "$['profile']['photo'].id")[0]; //cdee6e2a-5bf7-4957-b5ee-3a82e1fc9f55 //or var id = jsonPath(profile , "$..id")[1];

Related questions

0 votes
    My code is about bookStore with list of books. I need to extract all data(books) from a JSON file and put them in a ... console.log(e); } } function bookToHTMLRow(book) { return `...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I have one column in my table which will store data in string format the sample data is {"pre- ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    Which of the following is correct? A.We can use json data directly in axios B.we can use json data directly ... only we can use axios Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    What is the correct JSON content type?...
asked Jan 11, 2021 in Technology by JackTerrance
0 votes
    _________ extract a subset of rows from a data frame based on logical conditions. (a) rename (b) filter ( ... Analysis of R Programming Select the correct answer from above options...
asked Feb 9, 2022 in Education by JackTerrance
0 votes
    Learning RPA with UIPath. Happily extracting onscreen data from a website, processing it, using it, etc. However, ... this stage :/ Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    Download copy, extract data from an open system done fraudulently is treated as _________ (a) cyber-warfare (b) ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    Which of the following is used to extract data from HTML code of websites? (a) Webscraping (b) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 29, 2021 in Education by JackTerrance
0 votes
    ____________ is the NiFi element that is utilized to monitor incoming data, pull data from outside sources, publish data ... the options (2)Connection (3)Processor (4)Relationship...
asked Apr 18, 2021 in Technology by JackTerrance
0 votes
    Index structures are referred to as __________ since they provide a path through which data can be ... Operation in division Query Processing Techniques of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Explain what is the role of “Path Data Generator” in d3.js?...
asked Nov 14, 2020 in Technology by JackTerrance
0 votes
    _______is the syntax to read JSON data?...
asked Mar 4, 2023 in Technology by JackTerrance
0 votes
    I have json file as follows: { "status":"UP", "diskSpace": {"status":"UP","total":63279460352," ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    I have an incoming json object that represents the data pulled from a database structure. I would like to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 24, 2022 in Education by JackTerrance
...