How to use deep path

69 views
Skip to first unread message

35niavlys

unread,
Dec 2, 2015, 2:46:50 PM12/2/15
to JsonPath, 35ni...@gmail.com

Hi,

 

For exemple I have the following json

 

{

    "scheduler": {

        "schedulerInfo": {

            "type": "fairScheduler",

            "rootQueue": {

                "queueName": "root",

                "childQueues": [{

                    "queueName": "root.firstlevel1"

                }, {

                    "queueName": "root.firstlevel2",

                    "childQueues": {

                        "queueName": "root.firstlevel2.aze"

                    },

                    "childQueues": {

                        "queueName": "root.firstlevel2.b"

                    }

                }]

            }

        }

    }

}

 

I would like to have the queueName of all childQueue.

I use the following expression : "$..childQueues.queueName"

 

The result is :

 

[

   "root.firstlevel2.b"

]   

 

 

How to have :

 

[

   "root.firstlevel1",

   "root.firstlevel2",

   "root.firstlevel2.a",

   "root.firstlevel2.b"

]

 

 

Thanks

Mitesh Bhawsar

unread,
Jul 19, 2016, 6:18:50 AM7/19/16
to JsonPath, 35ni...@gmail.com

Use this,

$..childQueues..queueName
Reply all
Reply to author
Forward
0 new messages