orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Studio's Functions and Browse return different result

Open paynechu opened this issue 12 years ago • 5 comments

Please see images below, I created a testing function call 'xsm' just return a sum up value. Functions page the return is [{"@type":"d","@version":0,"value":"44"}] And Browser page the return is

-2:0 0 8

Why will they have different value? Seems Functions page will always pass the value by string? And the return will always a record cannot just the value?

screen shot 2014-04-22 at 9 19 48 pm screen shot 2014-04-22 at 9 20 10 pm

paynechu avatar Apr 22 '14 13:04 paynechu

It doesn't return function version but just the resulting version that is always 0.

lvca avatar Apr 22 '14 13:04 lvca

The results between query and function aber different: 44 vs 8

christian-laakmann avatar Apr 22 '14 17:04 christian-laakmann

You are right, I suppose the issue there is that REST API for function execution always recognize parameters as strings.

We have 2 options:

  1. Manually define parameter type
  2. Figure out parameter type in the same way as we do in SQL. E.g. if parameter surrounded by " characters it is a string, if surrounded by [ and ] it is a list and so on.

I would like the second option.

enisher avatar Apr 22 '14 22:04 enisher

I like the second option also. :+1:

paynechu avatar Apr 23 '14 01:04 paynechu

seems the issue also cause have no way to pass the RecordID as a parameter to function

screen shot 2014-04-24 at 8 31 16 pm

paynechu avatar Apr 24 '14 12:04 paynechu