Hi,
Is it possible to do a n1ql query on hierarchical data? For example, consider I have a files and folders, folders can contain more files and folders. I realize I can store all the data as one document, but my question is about storing each file/folder as an individual document. File/folder would have name and id properties, folder would have an array of folder/file ids that it contains.
Is there a query that can get this all at once? I see there are subqueries, but I don’t think I can use that for this case, where the hierarchy depth isn’t known up front. Would I just pick an arbitrary depth and repeat the subquery that many times?
I see another similar question, Query tree like data similar to Oracle’s Connect By Prior db statement, that was prior to the release of n1ql, where it refers to CTEs…but I don’t think that’s quite the same as subqueries, is it?
Thanks for any help,
Todd