JSONSelect icon indicating copy to clipboard operation
JSONSelect copied to clipboard

Enhancement: Excluding properties from traversal

Open dbo opened this issue 11 years ago • 2 comments

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?

dbo avatar May 26 '14 09:05 dbo

I am proposing something like https://github.com/dbo/JSONSelect/commit/be8f5b4a0c8d3fc2601c2177d82872736e242dd4

dbo avatar May 26 '14 14:05 dbo

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.

danvk avatar Oct 06 '14 23:10 danvk