Expand my Community achievements bar.

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

Avatar

Level 4

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

4 Replies

Avatar

Level 3

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

Avatar

Level 4

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.

Avatar

Level 3

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.

Avatar

Level 10

Agreed - for this - look like you will ahve to interate through the result set to seek what you are looking for.