Closed G3GDan closed 1 week ago
The members
function should do the trick. Here's an example of how I use it:
Thought I'd better report back...
Yes, using members works well. For various reasons it has taken us a while to get to the stage of implementing a new version of our code.
As there didn't seem to be a need/enthusiasm for metadata methods, let's close this.
This is a query rather than an issue. I'm using ajson to parse data which arrives as nested collections. Currently accessing the data in MT_JSON_TREE to obtain the number of Children for processing in a do loop. I then construct the expected path values in turn before various calls to get() methods.
Is there a benefit to a method which returns the number of Children? There is already get_node_type() but possibly other metadata could be exposed in a similar way.
I realise another option is for me to call exists() for each path and exit my loop once I reach the last member in the collection. Or possibly members() may offer another way.
Happy to submit my implementation for get_node_children() - but it will be fairly trivial!