Hi, All.
I'm using orientdb-community2.0.8.
i make custom function on studio.
funtion name is getBestReply.
var graph = orient.getGraphNoTx();
try{
var results = graph.command('sql',"select bdy, ruid, rdt,
out('SRLE').size() as cnt from story_reply where in('SE') in " + pRID + "
order by cnt desc, rdt asc limit 1 ");
}catch(err){
return "[]";
}
return results.getRecord();
so, i called select command in graphdb.
My source :
OrientGraph graph = new OrientGraph("remote:host/dbname, "id", "password)");
for (Vertex v : (Iterable<Vertex>)graph.command(new OCommandSQL("select
@rid, ruid, bdy, rdt, out('SIE').ext as ext, out('SIE').idx as idx,
out('SIE').color as color, out('SLE').size() as lcnt, out('SE').size() as
rcnt, out('SLE').lk_userid as lk_user, *ifnull(if(out('SE').out('SRLE').size()
> 0, getBestReply(@rid)), '[]') as btrep* from story where use = '0' and
uid = 'bodying1951' limit 50 order by rdt desc")).execute())
{
JsonParser parser = new JsonParser();
String s = v.getProperty("btrep").toString();
System.out.println(s);
}
output
is com.tinkerpop.blueprints.impls.orient.OrientElementIterable@44a7bfbc.
i want to get result set with another data.
how can i to do get function data and select filed?
thank you.
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.