If we need support traverser in has

32 views
Skip to first unread message

Stark Arya

unread,
Aug 30, 2022, 4:28:52 AM8/30/22
to Gremlin-users
Scenario
If we need to filter something(like label) by the traverser. like following, we must use WherePredicateStep to do filtering:
gremlin> g.V().as("f").out().as("e").where("e", eq("f")).by(label)
==>v[2]
==>v[4]


but this write style may be confused, if we could just write as:
g.V().as("f").out().has(label, eq(select("f").label()))
It's more understandable

this may need to change Compare function to judge if first is traverser and do special logic:
eq {
public boolean test(final Object first, final Object second) {
return null == first ? null == second : (Compare.bothAreNumber(first, second) ? NumberHelper.compare((Number)first, (Number)second) == 0 : first.equals(second));
}

public Compare negate() {
return neq;
}
},

do we have the need to do so? 

Stephen Mallette

unread,
Aug 30, 2022, 6:33:36 AM8/30/22
to gremli...@googlegroups.com
There's been discussion to add that kind of feature in 3.7.x

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/5e881710-258b-40d8-944f-a819a11cb99an%40googlegroups.com.

Stark Arya

unread,
Aug 30, 2022, 10:31:18 AM8/30/22
to Gremlin-users
OK,thanks your replay!
Reply all
Reply to author
Forward
0 new messages