For these tests, we'll use slightly more complicated objects with additional levels.
Each cJobject has a parent link as well a children link, so we can access the parent's info
The find(key) method will return the first object that has a property name matching the given key.
Each cJobject has a parent link as well a children link, so we can access the parent's info from the child, and find a peer property.
And of course we can chain all this
It can be useful to find an item in an array whose property value matches a particular value. In this example we'll find the property that matches the value "Mary", and stringify the parent so we can see all the properties for Mary.
Sometimes JSON objects can get fairly complicated and you may know the value you are looking for but not exactly the key. You can use the findByValue() method to find the first object matching the value you want to match
.. and you can chain this to make it more useful
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > excel to json and back > cJobject deep dive >