Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

QueryBuilder to extract specific nodes based on jcr:lastmodified

Avatar

Level 10

Hello,

Is there a way to pick up nodes of specific resource types eg:foundation/components/text and test/components/textCustom, under a specific path, /content/Test/en_US, and retrieve the ones modified in past 2 days?

Please let me know.

Regards,

NZ

1 Accepted Solution

Avatar

Correct answer by
Level 7

You could also use this:
 

map.put("relativedaterange", "@jcr:content/cq:lastModified"); map.put("relativedaterange.lowerBound", "-2d");

for changes made in the last two days :)

Good Luck
/Johan

View solution in original post

4 Replies

Avatar

Level 10

The QueryBuilder API is built on JCR API. Having said that -- see this thread that talks about your use case:

http://jackrabbit.510166.n4.nabble.com/Querying-for-all-modified-nodes-based-on-jcr-lastModified-td5...

HTH

Avatar

Level 10

Thanks Scott, had figured it out earlier, appreciate help.

daterange.property=jcr:lastModified
daterange.property.and=true
daterange.lowerBound=2013-09-09
daterange.lowerOperation= >=
daterange.upperBound =2013-09-14

 

Regards,

Nicole

Avatar

Correct answer by
Level 7

You could also use this:
 

map.put("relativedaterange", "@jcr:content/cq:lastModified"); map.put("relativedaterange.lowerBound", "-2d");

for changes made in the last two days :)

Good Luck
/Johan

Avatar

Level 2

hi,

 

I want to search for assets in the whole Dam just excluding a folder(read expired folder). how can i achieve it.. 

 

please help.

thank you.