Console gobbles up the semi-colon character - OrientDB version 2.2.9

Skip to first unread message

Amir Khawaja

Sep 9, 2016, 9:51:55 AM9/9/16
to OrientDB
Hello Everyone. I have noticed that the console behavior when using JS has changed in OrientDB version 2.2.9 to where I can no longer execute Javascript commands. Consider the following example:

orientdb {db=mydb}> js var r = db.query('select date()', []);print(r);end

When I press return at the end of that statement I receive the following error:

[Started multi-line command. Type just 'end' to finish and execute]

Error: com.orientechnologies.orient.core.command.script.OCommandScriptException: ScriptManager: error <eval>:1:38 Expected ; but found print
var r = db.query('select date()', []) print(r);
                                      ^ in <eval> at line number 1 at column number 38.
Function unknown:

   1: >>> var r = db.query('select date()', []) print(r);

        DB name="mydb"

I also tested this with a more simpler version of the JS as follows:

js var i = 1;print(i);end

The result was the same. I have the script interpreter feature enabled. Here is the relevant section from the orientdb-server-config.xml file:

<handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter">
        <parameter value="true" name="enabled"/>
        <parameter value="SQL,Javascript" name="allowedLanguages"/>

Is this a bug or did I miss something?


Sep 9, 2016, 10:49:27 AM9/9/16
to OrientDB
Hi, you could use this command

js; var i = 1; print(i); end;

Hope it helps.

Amir Khawaja

Sep 9, 2016, 11:31:22 AM9/9/16
to OrientDB
That worked. Adding the semi-colon after the "js" keyword did the trick. Thank you.

Reply all
Reply to author
0 new messages