Dileepa
Dileepa

Reputation: 1039

AEM: How to find the nodes with property name "customProp" and empty property value, using query builder?

There are nodes which have properties but no values.

I am trying to avoid those nodes in query builder using,

path=/content/
type=cq:Page
2_property=jcr:content/customProp
2_property.operation=exists
3_property=jcr:content/customProp
3_property.operation=unequals
3_property.value=

But the empty value condition (3_property) is being ignored. How this can be achieved?

Upvotes: 1

Views: 2362

Answers (1)

Sören
Sören

Reputation: 167

I had the issue to search for all occurrence of a propertiy with no value. I constructed the following SQL2 Query:

SELECT * FROM [{{jcr:primaryType}}] AS ref WHERE ISDESCENDANTNODE([{{Start Path}}]) AND ref.[{{Property Name}}] = ''

In your case I think something like should work

SELECT * FROM [{{jcr:primaryType}}] AS ref WHERE ISDESCENDANTNODE([{{Start Path}}]) AND NOT(ref.[{{Property Name}}] = '')

Upvotes: 1

Related Questions