Hello there,

I’m trying to order some nodes by how many child nodes they have and i’ve 
stumped upon a headache.
My query looks like this:

"SELECT * FROM 'nt:hierarchyNode' AS node
WHERE ISCHILDNODE(node, ‘/some/given/path’) 
ORDER BY 'jcr:primaryType' DESC, LENGTH(node) ASC”

This is taking all child nodes of a given node and ordering the nt:folders 
first (before the nt:files). However, the
LENGTH(node) does not seem to be doing what I want it to do (count the number 
of children). Is there anything
oak-specific that could solve my problem, like Modeshape’s CHILDCOUNT() or like 
having a custom function
somehow?

Kind regards,
Milan Milanov

Reply via email to