Remote variables and functions with console

29 views
Skip to first unread message

Sean Robertson

unread,
Jan 15, 2017, 5:44:46 AM1/15/17
to Gremlin-users
Is there a way to set variables and functions when using a remote connection with the console?

gremlin> :> i = 3
==>3
gremlin
> :> i
No such property: i for class: Script53

My use case was to define a "getOrCreate" function to use with a remote gremlin-server.

Stephen Mallette

unread,
Jan 16, 2017, 7:03:40 AM1/16/17
to Gremlin-users
If you want to preserve variables when remoting, then you need to specify the "session" argument to :remote - see here:


--
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/3fc9ea59-b3e2-44d5-a0f8-5f99196390eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Henderson

unread,
Jan 16, 2017, 11:37:29 AM1/16/17
to Gremlin-users
You can add functions/variables to the startup script. The Starting Gremlin Sever section talks a little about this under the "Graph Instances to expose" section http://tinkerpop.apache.org/docs/current/reference/#starting-gremlin-server
Reply all
Reply to author
Forward
0 new messages