I have multiple nodes with node name abc in AEM repository. For some of the nodes it will have property expirationDate. I need to get all the nodes with node name abc. If in case that node has expirationDate property then exclude all the expired nodes. Is there any query which returns this instead of getting all the nodes then checking each node whether it is expired or not?
adding sample content json :
{
"jcr:primaryType":"cq:Page",
"jcr:createdBy":"admin",
"jcr:created":"Wed Apr 11 2018 17:01:59 GMT+0530",
"page1":{
"jcr:primaryType":"cq:Page",
"jcr:createdBy":"admin",
"jcr:created":"Wed Apr 11 2018 17:02:16 GMT+0530",
"abc":{
"jcr:primaryType":"nt:unstructured",
"expiration":"2018-04-8"
}
},
"page2":{
"jcr:primaryType":"cq:Page",
"jcr:createdBy":"admin",
"jcr:created":"Wed Apr 11 2018 17:04:15 GMT+0530",
"abc":{
"jcr:primaryType":"nt:unstructured",
"expiration":"2018-04-10"
}
},
"page3":{
"jcr:primaryType":"cq:Page",
"jcr:createdBy":"admin",
"jcr:created":"Wed Apr 11 2018 17:04:41 GMT+0530",
"abc":{
"jcr:primaryType":"nt:unstructured",
"expiration":"2018-04-25"
}
},
"page4":{
"jcr:primaryType":"cq:Page",
"jcr:createdBy":"admin",
"jcr:created":"Wed Apr 11 2018 17:05:07 GMT+0530",
"abc":{
"jcr:primaryType":"nt:unstructured"
}
}
"page5":{
"jcr:primaryType":"cq:Page",
"jcr:createdBy":"admin",
"jcr:created":"Wed Apr 11 2018 17:05:07 GMT+0530",
"abc":{
"jcr:primaryType":"nt:unstructured"
}
}
}
In this example current date is 2018-04-11 (YYYY-MM-dd). page1/abc and page2/abc nodes are expired. Output should have
page3/abc
page4/abc
page5/abc
Thanks in advance.
Regards,
Vasim