0

In this gremlin query:

g.V('c3833064-94aa-4084-9c0e-029543d69892').as('self')
.sideEffect(out('rated').store('movies'))
.out('friended')
.group()
.by()
.by(outE('rated')
.where(values('rating').is(gt(5)))  //filter on positive scores on common rated items
.inV()
.where(within('movies')).count())
.order(local)
.by(values,desc)
.unfold().limit(10)
.select(keys)
.project('id','label','username', 'avatarUrl', 'name')
.by(id)
.by(label)
.by('username')
.by(coalesce(values('avatarUrl'), constant('')))
.by('name')

How can I exclude the 'self' user (c3833064-94aa-4084-9c0e-029543d69892) from the results. Also, suppose I want to exclude a username called 'Admin' from the results, too. How can I filter out these items?

Note: I tried adding .in('friended').where(neq('self')) just after out('friended') and that seemed to exclude self from the results. can i add an 'and' condition to this to exclude the 'Admin' user, too?

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
Programjon
  • 23
  • 6

1 Answers1

0

I think the simplest construct to exclude multiple vertices by id is:

g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
g.V().where(id().is(without(1, 2)))
==>v[3]
==>v[4]
==>v[5]
==>v[6]
HadoopMarc
  • 1,356
  • 3
  • 11