Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-06-2021 04:29 AM
Hi all,
I'm struggling with a certain question I want answered:
The first part of my query is the following (it's a Bloodhound context):
"Give me all the domain admins that have "AMD_" as part of their username, as those are the human DA's, and show me all their first order group memberships." I translated this to:
MATCH (u:User)-[:MemberOf*1]->(g:Group {name:'DOMAIN ADMINS@FOO.LOCAL'})
WHERE u.name STARTS WITH "ADM_"
WITH u MATCH p=(u)-[:MemberOf*1]->(n:Group) return p
As one can imagine, this gets ugly fast. With 20 admins at the moment, and 20-50 memberships each. Graphically unusable. What I now would like is to show only those groups that a subset of the "ADM_"'s is member of. (or be able to show only those groups that less than x "ADM_"'s are member of, to make it a bit more generic) So basically remove any node where:
Maybe a more generic description of the problem would be:
"Show me a graph of group memberships proper subsets (A⊂B) of a given set of nodes are member of."
I think the first approach would be easier, but I don't know how to count these incoming memberof connections.
Looking forward to your help.
09-06-2021 02:09 PM
Assuming the 'Group' node has a property 'member' that stores the DA's name
MATCH (g:Group)
where g.member STARTS WITH("AMD_")
Return g
All the sessions of the conference are now available online