Highlighted

Query to fetch Assets where jcr:content/metadata/jcr:lastModified is greater than jcr:content/cq:lastReplicated

Avatar

Avatar

Selva123

Avatar

Selva123

Selva123

08-06-2016

Hi All,

I need to fetch the assets where "jcr:content/metadata/jcr:lastModified is greater than jcr:content/cq:lastReplicated".

Is it possible to compare to two metadata values while querying. Please help me in writing the query for this scenario.

So far I am aware is the daterange predicate which is querying a metadata date property against a specific date.

Thanks,

Selva

Replies

Highlighted

Avatar

Avatar

stevec2515680

Avatar

stevec2515680

stevec2515680

08-06-2016

Highlighted

Avatar

Avatar

pradeepn6086740

Avatar

pradeepn6086740

pradeepn6086740

01-05-2019

HI Selva123

Did you able to solve the issue?

Thanks,

Pradeep

Highlighted

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

02-05-2019

I don't think so we can compare dynamic operand with another dynamic operand but static values

DynamicOperand Operator StaticOperand

you can try to write simple servlet to achieve this, without writing queries or use Sling Queries instead of JCR queries.

cq5 - JCR SQL2 compare properties on same node - Stack Overflow

Sling Query vs JCR