Search code examples
resttraversalorientdb

Not able to execute sql query with traverse in Orientdb restapi


I am new to OrientDB. I am trying to run the query "traverse * from #11:4 while $depth<=3" on the REST client (mentioned here). The query gives a valid graph with correct nodes when run on the local orientDB client. But gives the following error while trying to run the REST client.

Query,

http://localhost:2480/query/sample/sql/traverse * from #11:4 while $depth<=3

Response

com.orientechnologies.orient.core.exception.OQueryParsingException: Error on parsing query at position #8: Missed FROM
Query: traverse * from
-------------^

Can any of you highlight as to what is going wrong?


Solution

  • Did you escape # in your http call?

    Seems like this problem

    traverse * from
    

    This is the query that arrive to OrientDb so i'm guessing it is a # problem

    You can also use POST command instead of GET query so you can put the query in the body

    see here

    http://www.orientechnologies.com/docs/last/orientdb.wiki/OrientDB-REST.html#post---command