simple where() with variable not working?

19 views
Skip to first unread message

Eser Kandogan

unread,
Dec 3, 2016, 9:25:36 AM12/3/16
to Gremlin-users
r = g.V(1).next()
g.V().hasLabel('person').where(neq(r)) returns 
com.thinkaurelius.titan.graphdb.vertices.CacheVertex cannot be cast to java.lang.String

also tried:
g.V().hasLabel('person').as('p').where('p',neq(r))

What is wrong here?

(Using 3.0.1)

Daniel Kuppitz

unread,
Dec 3, 2016, 9:31:04 AM12/3/16
to gremli...@googlegroups.com
where(neq(x)) requires x to be a label or a side-effect key. What you could do is this:
  1. g.V().hasLabel('person').hasId(neq(1))

  2. r = g.V(1).next()
    g.V().hasLabel('person').is(neq(r))
Cheers,
Daniel


--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/259d0d08-1ac5-40d1-a37f-ee55db9a2ace%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eser Kandogan

unread,
Dec 5, 2016, 2:51:49 PM12/5/16
to Gremlin-users
Thanks.

Reply all
Reply to author
Forward
0 new messages