Reputation: 522
For example, there are two types of vertex in Graph [ Account , User]. Account vertexes have edges to user vertex denoting a list of users form an Account vertex. User vertex has two property ( name, phoneNumber). I want to select accounts who are connected to more than 2 users whose name starts with foo.
The output should not contain accounts who have more than 2 edges to User vertex but out of all those users, only 1 user's name starts with foo. At minima, 2 users should have name which starts with foo.
Upvotes: 0
Views: 458
Reputation: 1419
This query would do it:
g.V().hasLabel("Account")
.where(out().hasLabel("User")
.has("name", startingWith("foo"))
.count().is(gte(2)))
Upvotes: 1