Search code examples
orientdborientdb-2.1

How to escape field name in orientdb


I'm having a class with fields like from and to in an orientdb database.

How do I execute a query that select the from and to fields?

I tried select [from] from Activity but it is complaining about [.


Solution

  • You have to disable the strictSql using this command:

    ALTER DATABASE custom strictSql=false
    

    and then you have to use the backtick:

    SELECT `from` FROM Activity