Open dbo opened 10 years ago
I am proposing something like https://github.com/dbo/JSONSelect/commit/be8f5b4a0c8d3fc2601c2177d82872736e242dd4
I implemented something like this in pyjsonselect. I hadn't thought of the circular reference use case, but it can be a huge performance boost for any large object.
The selected object tree needs to be acyclic, which is quite inconvenient if you are cross referencing branches. An indirection via an external map helps, but is not really elegant, IMO. I'd rather suggest a "special" key being excluded on traversal, e.g. "__meta" (should be customizable) which could serve as such.
In conjuction with issue #58 (parent access in forEach), this offers a lot of flexibility traversing an object tree.
What do you think?