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

别等时光非礼了梦想. 提交于 2019-12-13 02:06:08

问题


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?


回答1:


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}}] = '')


来源:https://stackoverflow.com/questions/36140247/aem-how-to-find-the-nodes-with-property-name-customprop-and-empty-property-va

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!