Queries with not exists condition | Community
Skip to main content
akhilraj
Level 5
October 10, 2022
Solved

Queries with not exists condition

  • October 10, 2022
  • 1 reply
  • 817 views

Hi,

 

Is there any query available for not exists condition.

We need to find list of pages whose cq:lastModified property is not available.

I tried with  below but it seems not proper.

 

path=/content/hr/stock/ubs
1_property=@jcr:content/cq:lastModified
1_property.operation=not exists
p.limit= -1

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by spidey1405

Try this:

path=/content/hr/stock/ubs
1_property=@jcr:content/cq:lastModified
1_property.operation=exists
1_property.value=false
p.limit= -1

 

property.operation can take one of the following values while using the property predicate evaluator.

  1. equals for an exact match.
  2. unequals
  3. like partial matching
  4. not for no match
  5. exists for existence match

In your case to search for all nodes where  the property `@jcr:content/cq:lastModified` doesn't exist.

 

 

 

1 reply

spidey1405Accepted solution
Level 4
October 10, 2022

Try this:

path=/content/hr/stock/ubs
1_property=@jcr:content/cq:lastModified
1_property.operation=exists
1_property.value=false
p.limit= -1

 

property.operation can take one of the following values while using the property predicate evaluator.

  1. equals for an exact match.
  2. unequals
  3. like partial matching
  4. not for no match
  5. exists for existence match

In your case to search for all nodes where  the property `@jcr:content/cq:lastModified` doesn't exist.

 

 

 

akhilraj
akhilrajAuthor
Level 5
October 10, 2022

Thank you so much.

A slight change to get proper result.

We have to add type=cq:Page to get proper result.

 

path=/content/hr/stock/ubs
type=cq:Page
1_property=@jcr:content/cq:lastModified
1_property.operation=exists
1_property.value=false
p.limit= -1