Can we find all those nodes which have multi valued property using SQL2 | Community
Skip to main content
Level 4
November 9, 2016

Can we find all those nodes which have multi valued property using SQL2

  • November 9, 2016
  • 1 reply
  • 5334 views

Hi,

My requirement is to find all the pages with a particular property being multi-valued i.e. I want to find all the pages with property type as String[] using SQL2 query.

 

Regards,

Shallu

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

1 reply

Anton_Smulskiy
Level 3
November 10, 2016

Hi,

Do you know the name of your property?

Is it always multi-value?

If yes, just search for nodes with your property name

Example: SELECT * FROM [cq:PageContent] AS s WHERE ISDESCENDANTNODE([/content/geometrixx-outdoors]) and [jcr:mixinTypes] is not null

Level 4
November 10, 2016

Hi Anton,

 

Actually property value can be single values(String) or multi-valued(String[]), that's where I need to find all the nodes where property value is multi-valued.

Anton_Smulskiy
Level 3
November 10, 2016

AFAIK there is no way to find only String[] properties. I suggest to use Sling / JCR API to execute query and find all nodes with your property and then iterate through result and filter multi-valued properties.