Thanks for the answers. I see that I probably simplified this too much. The problem I have is that I have a set of vertices, and given that set, I want to find the vertices that has more than one inE to that set. So more like this:
g.V().and(
hasLabel("FooBar"),
has("someProperty", eq("SomeValue")),
outE("Some additonal edge that helps defines the set"))
.in().hasLabel("RecordType").groupCount()
.unfold()
.filter(select(values).is(gt(1))).select(keys)
I tried out some variations of your proposed solutions like:
g.V().and(...).in().where(__.hasLabel("RecordType").count().is(gt(1)))
and
g.V().and(...).inE().where(__.outV().count().is(gt(1)))
But those all returned an empty result.
When I run
g.V().and(
hasLabel("FooBar"),
has("someProperty", eq("SomeValue")),
outE("Some additonal edge that helps defines the set"))
.in()
It returns something like this:
v[4]
v[4]
v[3]
So that means that v[4] has more than one edge to something in the set, and I'm trying to limit the results to only those with multiple edges to the set (i.e. v[4] in this example).
Thank you all for the help so far, makes getting started with Gremlin a lot easier!
- Erik