AEM Query date range property to query

Avatar

Avatar
Validate 1
Level 2
pn_2007
Level 2

Likes

4 likes

Total Posts

42 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
pn_2007
Level 2

Likes

4 likes

Total Posts

42 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 3
Boost 1
View profile
pn_2007
Level 2

14-09-2020

I have a query as below:

 

path=/home/project/users
property=customGroup
property.value=Unverified
type=rep:User

 

From this result I need to filter whose

registrationCompletedDate or jcr:createdDate value is greater than 5 days Both these properties are of type Date.

Can you help how I need to modify the query ? Do we have any property to get the dte greater than a particular value?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

14-09-2020

Hi @pn_2007,

You can make use of predicate named "relativedaterange" to achieve this.

Below is the sample query. (To get all assets that are modified 5 days before)

path=/content/dam/learnings
type=dam:Asset
relativedaterange.property=jcr:content/jcr:lastModified
relativedaterange.lowerBound=-5d  (If no upperBound is specified, it is treated as 0, indicating current time)
p.limit=-1

If any Date property which is in future like say eventDate and to get all events that will happen in next 5 days, then the query will be like

path=/content/dam/learnings
type=dam:Asset
relativedaterange.property=jcr:content/eventDate
relativedaterange.upperBound=5d  (If no lowerBound is specified, it is treated as 0, indicating current time)
p.limit=-1

Other options in detail about this predicate in below link

 

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

106 likes

Total Posts

119 posts

Correct reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
MVP
Albin_Issac
MVP

Likes

106 likes

Total Posts

119 posts

Correct reply

33 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Albin_Issac
MVP

14-09-2020

Try something as below

p.limit=-1
p.hits=full
path=/home/project/users
property=customGroup
property.value=Unverified
type=rep:User
group.1_relativedaterange.property=jcr:created
group.1_relativedaterange.upperBound=-5d
group.2_relativedaterange.property=registrationCompletedDate
group.2_relativedaterange.upperBound=-5d
group.p.or=true

Even you can use daterange instead of relativedaterange.

Regards

Albin I

www.albinsblog.com