I'm trying the following javascript server side function. I want to access the returned user IDs :
var gdb = orient.getGraph();
var friends= gdb.command( "sql", "select userid from (select expand(out(\"Friend\")) from User where userid= 1)" );
var first_friend= friends[0]; // friends is definitely not empty
return first_friend['userid']; // incorrect return. also tried first_friend.field("userid") and first_friend.userid
If just returning first_friend:
[
{
"@type": "d",
"@rid": "#-2:0",
"@version": 0,
"userid": 21
}
]
Thank you for the help in advance.