Showing posts with label JCR SQL2 Query. Show all posts
Showing posts with label JCR SQL2 Query. Show all posts

Monday, March 3

JCR SQL2 Query to exclude a path

JCR Query to select data from one parent path and at the same time exculding a child path




For example

I want to select all nt:unstructured PDF nodes under en folder except nodes falling under investor-resource folder









     select * from [nt:unstructured] as p
            where
               (isdescendantnode (p, [/content/dam/gsam/pdfs/us/en/])
               AND NOT isdescendantnode (p, [/content/dam/gsam/pdfs/us/en/investor-resources]))
                         and contains(p.*, 'application/pdf')