Home > Blockchain >  How to find the json dynamic array using JSON path finder in node js
How to find the json dynamic array using JSON path finder in node js

Time:06-14

I want to fetch some dynamic id in the below given json file using JSON path finder in npm package.

Sample.json

[
    {
        "4787843417861749370": [
            {
                "type": "Fast delivery",
                "subtype": "verizon",
                "status": "Dispatched",
                "reason": "null",
                "currency_code": "USD"
            }
        ],
        "1502698381711920904": [
            {
                "type": "Normal delivery",
                "subtype": "Cisco fiber",
                "status": "Added Cart",
                "reason": "null",
                "currency_code": "USD"
            }
        ]
    }
]

Output (The below are dynamic id from the above sample. json file):

[4787843417861749370,1502698381711920904]

I have the similar type of the json file which contains n number of dynamic id as JSON sub array. Can someone help me to fetch all these dynamic array from the json file as like above?

CodePudding user response:

You can use the expression

  • Related