Frage

I'm using neo4j 1.7 through the REST interface, and I punched in the following query:

{"script": "g.v(1).aggregate(x); g.V.except(x)", "params": {"x":[]}}

which should return the list, missing Node 1, but instead this returns the entire list of Nodes. I've looked over the neo4j documentation and see examples of using variables, but this query does not seem to behave as exepected.

Has anyone else run into this problem or is this something can't/shouldn't be done through the gremlin REST interface?

War es hilfreich?

Lösung

When you're not in the Gremlin REPL, you need to manually iterate expressions when it's not the last expression returned (the Gremlin Plugin automatically iterates the last expression):

g.v(1).aggregate(x).iterate(); g.V.except(x)

But you can simplify it down to one statement like this:

g.V.except([g.v(1)])
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top