I've been working on library that creates a queryable structure for trees like this. I prefer writing normal JS than to having some query language for it.
var obj = minim.toElement({
a: 1,
b: [
{
c: 1,
d: 2,
e: [ { f: 5 } ],
f: 6
}
]
});
// Results are [5, 6]
var results = obj.find(function(value, key) {
return key.equals('f');
});
See https://github.com/refractproject/minim