내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

How to get the list of user's group which is having count of user's less than 5?

Avatar

Level 5

Hi all,

 

How to get the list of user's group which is having count less than 5 using query debugger? Please share the query statement for this condition. Aem version is aem cloud

 

Thank you.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

No, you can't check that.

I don't know your use case but you can leverage jcr:createdBy property to filter out further

Arun Patidar

AEM LinksLinkedIn

원본 게시물의 솔루션 보기

4 답변 개

Avatar

Community Advisor

Hi @keerthana_hn 

I dont think you can a write a query in debugger to find the number of users in each group. You might need to use the group API [1] in custom code and call the getMembers() method and iterate it to find the size.

 

[1] https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/org/apache/jackrabbit...

Avatar

Community Advisor

Hi,

You cannot achieve this using query alone, once you have results from below query then you need to write java code to check group member count

 

type=rep:Group
path=/home/groups
property=rep:members
property.value=true
property.operation=exists
p.limit=-1

 

arunpatidar_0-1668521394228.png

 

UserManager userManager = resourceResolver.adaptTo(UserManager.class);
Group group = (Group)  userManager.getAuthorizable(groupFromQuery);
if (group.getMembers() < 5){
// TODO
}

 

Arun Patidar

AEM LinksLinkedIn

Avatar

Level 5

Hi @arunpatidar ,

Can we check in query debugger whether the group is automatically created? Or is there any property that defines automatically created group?

Avatar

정확한 답변 작성자:
Community Advisor

No, you can't check that.

I don't know your use case but you can leverage jcr:createdBy property to filter out further

Arun Patidar

AEM LinksLinkedIn