You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have issues with early vs late function evaluation.
I have a very small Javascript function that returns the local Id of the vertex. for eg : onlyid(#12:13) should return 13.
it is written as return(rid.split(":")[1]); This runs fine in the webUI.
however when I execute this from the query console as :
select onlyid(@Rid) from Class1;
I get error Error:
Error: com.orientechnologies.orient.core.exception.OStorageException: Error on executing command: sql.select onlyid(@Rid) from Class1
Error: java.lang.RuntimeException: com.orientechnologies.orient.core.command.script.OCommandScriptException: Error on parsing script at position #0: Error on execution of the script
Script: onlyid
------^
Error: com.orientechnologies.orient.core.command.script.OCommandScriptException: Error on parsing script at position #0: Error on execution of the script
Script: onlyid
------^
Error: com.orientechnologies.orient.core.exception.OStorageException: TypeError: #19:0 has no such function "split" in at line number 71
Error: com.orientechnologies.orient.core.exception.OStorageException: TypeError: #19:0 has no such function "split"
The text was updated successfully, but these errors were encountered:
I think in WebUI it's receiving a string, so the split() works correctly.
When you execute it in a query, it will receive a RID object, that does not have a split method.
My suggestion is to change your function adding a toString(), eg.
I have issues with early vs late function evaluation.
I have a very small Javascript function that returns the local Id of the vertex. for eg : onlyid(#12:13) should return 13.
it is written as return(rid.split(":")[1]); This runs fine in the webUI.
however when I execute this from the query console as :
select onlyid(@Rid) from Class1;
I get error Error:
Error: com.orientechnologies.orient.core.exception.OStorageException: Error on executing command: sql.select onlyid(@Rid) from Class1
Error: java.lang.RuntimeException: com.orientechnologies.orient.core.command.script.OCommandScriptException: Error on parsing script at position #0: Error on execution of the script
Script: onlyid
------^
Error: com.orientechnologies.orient.core.command.script.OCommandScriptException: Error on parsing script at position #0: Error on execution of the script
Script: onlyid
------^
Error: com.orientechnologies.orient.core.exception.OStorageException: TypeError: #19:0 has no such function "split" in at line number 71
Error: com.orientechnologies.orient.core.exception.OStorageException: TypeError: #19:0 has no such function "split"
The text was updated successfully, but these errors were encountered: