Hi,
I have created this javascript function with parameters rid1 and rid2 

var g=orient.getGraph();
var b=g.command("sql","select from "+ rid1 + " where in('UserLikes') 
contains " + rid2);
if(b.length==0)
 return false;
return true;

and I have used this query

select post._id ,post.title as title, post.in("UserLikes").size() as 
totalLikes, myFunction(post.@rid,rid) as hasloggedUserLikedThisPost from (
select out("UserPosts") as post,@rid from User where _id="1" unwind post) 
where type="technical post"

and I have obtained

<https://lh3.googleusercontent.com/-joddamYts1E/V6xP4zSyx3I/AAAAAAAAAQk/KLPDHwlqat80aKZXT-V7RacwdYPVunUaQCLcB/s1600/2.png>

Hope it helps,
Alessandro

-- 

--- 
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.

Reply via email to