Expand my Community achievements bar.

SOLVED

Queries with not exists condition

Avatar

Level 6

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

1 Accepted Solution

Avatar

Correct answer by
Level 5

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.

 

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

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.

 

 

 

Avatar

Level 6

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