Using gremlin query in JS function

Skip to first unread message

Jun 1, 2015, 4:28:28 AM6/1/15

I'm facing the following problem:
I should use complex traversal queries through the HTTP API.
Since these queries could be saved, I was thinking about writing a JS function so it can be called remotely.
I saw that db.command can accept gremlin queries as well, but when I try it, it always throws an NPE.
It seems to me, that 'g' is null.
Could somebody please show me an example to this? I googled it, but found almost nothing.

And one more question:

When using the SQL traversals, is there a way to issue complex traversals?
If I'm using something like the example "SELECT out('follow').out('follow') FROM TwitterAccounts"
Is there a way to say to use 1...x out parts?
I mean "Find all the nodes connected to this one with the edge "A". Then list the whole tree which is connected through edges "B".
Like in Cpyher one could say [1..*]


Reply all
Reply to author
0 new messages