As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hello,
A guess of answer from https://doc.nuxeo.com/nxdoc/nxql/ :
ecm:ancestorId: the id of an ancestor of the document (parent, grand-parent, etc., up to the root). This is only useable in a WHERE clause with the syntax ecm:ancestorId = 'some-doc-id' or ecm:ancestorId <> 'some-doc-id'. It's an alternative to ecm:path STARTSWITH '/some/doc/path' if you know the id instead of the path. See also ecm:path. (Since Nuxeo 5.9.6)
WHERE
ecm:ancestorId = 'some-doc-id'
ecm:ancestorId <> 'some-doc-id'
ecm:path STARTSWITH '/some/doc/path'
So If you're looking for a NXQL query to be used in a Nuxeo client, SELECT * FROM Folder WHERE ecm:ancestorId = <top folder id> or SELECT * FROM Document WHERE ecm:ancestorId = <top folder id> AND ecm:primaryType IN ('Folder', 'your custom type'...) might look like an answer to your question.
SELECT * FROM Folder WHERE ecm:ancestorId = <top folder id>
SELECT * FROM Document WHERE ecm:ancestorId = <top folder id> AND ecm:primaryType IN ('Folder', 'your custom type'...)
Would you want only first level subfolders, the NXQL query would look like: SELECT * FROM Folder WHERE ecm:parentId= <top folder id> or SELECT * FROM Document WHERE ecm:parentId = <top folder id> AND ecm:primaryType IN ('Folder', 'your custom type'...)
SELECT * FROM Folder WHERE ecm:parentId= <top folder id>
SELECT * FROM Document WHERE ecm:parentId = <top folder id> AND ecm:primaryType IN ('Folder', 'your custom type'...)
Hi,
Hi Patrick,
Getting all the sub-folders of a folder worked. Is there any way I can get sub-folders only till required level. I mean if I need only till second level or third level. Can we control how many levels to get?
Thanks in advance!!
There is nothing out of the box except all levels or first level. You can however automate your custom need using some JavaScript automation,
I'm working on the backend only with java client I have no idea about java script. Is there a way we can do it on backend
hi Gregory [Gregory Carlin](https
Hello [Bhagat Singh](https