Highlighted

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

Avatar

Avatar

Shallu_Rohilla

Avatar

Shallu_Rohilla

Shallu_Rohilla

09-11-2016

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

Replies

Highlighted

Avatar

Avatar

Anton_Smulskiy

Avatar

Anton_Smulskiy

Anton_Smulskiy

09-11-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

Highlighted

Avatar

Avatar

Shallu_Rohilla

Avatar

Shallu_Rohilla

Shallu_Rohilla

09-11-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.

Highlighted

Avatar

Avatar

Anton_Smulskiy

Avatar

Anton_Smulskiy

Anton_Smulskiy

10-11-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.

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

10-11-2016

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