this scenario: have number of users vertex in orient-db. want retrieve users not friend of specific user friend edge. need gremlin command that. 1 me? thank you. diego
because want find users not friends specific user, i'm not sure there efficient way one. i'm using toy graph demonstrate, i'm assuming vertices user , edges friend edges. i'd like:
gremlin> g = tinkergraphfactory.createtinkergraph() ==>tinkergraph[vertices:6 edges:6] gremlin> l=[g.v(1)] set;g.v(1).out.fill(l) ==>v[1] ==>v[2] ==>v[4] ==>v[3]
so specific user list l
friends
gremlin> g.v.except(l) ==>v[6] ==>v[5]
then find else except people. wasn't friend of specific user or specific user himself. don't particularly have iterate g.v
involves linear scan of friends, can't think of easier way find not in initial set.
Comments
Post a Comment