If I have this JSON
{
a: {
b: {
c: {
id: "some-key",
d: {
e: {
<thousands and thousands of lines>
}
},
"this": "is the field I want"
}
}
}
}
How would I just return the properties of c
?
Reason for doing this, I need to identify an object with eg. "id": "some-key"
and return one of its other properties. In my example, d
and e
could be many Mb
s. I originally did this using JsonSlurper
but the file is so big I ran out of memory. I've already set -Xmx2048m
to no avail. Before I consider downloading more memory I'm assuming there must be some way of parsing the JSON without actually storing it? I'd rather use something that exists instead of writing my own parser.