What should I do to setup a new Gremlin version fo

2019-08-05 08:02发布

问题:

I am using Neo4j - Graph Database Kernel 1.8

It uses this gremlin version:

gremlin> Gremlin.version()
==> 1.5

which is very old version.

I want to upgrade to gremlin 2.0 or 2.1 from the github project, since I can't run this command on gremlin 1.5:

gremlin> g.v(1).outE.has("weight", T.gte, 0.5f).weight
==> No such property: T for class: groovysh_evaluate

My question is what should I do, so I won't mess up all the entire environment of neo4j.

回答1:

You can run:

import com.tinkerpop.gremlin.Tokens.T

To call the gremlin helper Tokens ("T") directly:

g.v(1).outE.has("weight", T.gte, 0.5f).weight

Or you can write:

g.v(0).outE.has("weight", Tokens.T.gte, 0.5f).weight

Write it in the gremlin shell.



回答2:

the Gremlin plugin and the server will be upgraded in the next weeks, is that ok?