Search code examples
javacassandrasql-order-bygremlintinkerpop3

gremlin order by query with incr


g.V().has(label,"request_job").order().by("submit_time",incr).valueMap("submit_time")

==>[submit_time:[1330647978000]]
==>[submit_time:[1330652298000]]

When I use, order() query in Gremlin console, it is working fine. But when I try the same query in Java, I am not able to use "incr", it is showing that undefined symbol "incr".

How to use "incr" with order() in Java?

Kindly help me to resolve this problem.


Solution

  • It is defined in the enum Order (javadoc) which is automatically imported by the Gremlin Console. You should add the following import to your Java class:

    import static org.apache.tinkerpop.gremlin.process.traversal.Order.*;