get all people connected to me that I talked to but did not purchase from

50 views
Skip to first unread message

ale...@fiverr.com

unread,
Feb 25, 2015, 7:32:14 AM2/25/15
to orient-...@googlegroups.com
Hey, 

I am kinda new to orientdb, struggling a little with some basic queries: 

I have a user -> [ talked_to ] -> user edges and also user -> [ordered_from] -> user edges. 
Given a certain user id, which is not the rid, but another property of user, i need to get all users that i talked to but did not purchase from or sold to...meaning that if u1 talked to u2 - will be returned, but if u1 talked to u2 but also purchased from u2 - won't be returned in the result. 

How can i accomplish that ?

Thanks a lot, 
Alex


Riccardo Tasso

unread,
Feb 26, 2015, 2:34:33 AM2/26/15
to orient-...@googlegroups.com
Hi, I think that difference is the function you need:

SELECT difference(out('talked_to'), out('odered_from'))
FROM Person
WHERE property = 5

Cheers,
   Riccardo

--

---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ale...@fiverr.com

unread,
Feb 28, 2015, 9:05:03 AM2/28/15
to orient-...@googlegroups.com
Hey, 

I tried doing: 

SELECT difference(both('TalkedTo'), both('OrderedFrom'))
FROM User
WHERE id = 111

but i seem to get :

[["#11:4","#11:15","#11:32","#11:34","#11:37","#11:59","#11:127","#11:4"],["#11:31","#11:15","#11:9","#11:32"]]

which seems just the vertices on each group - both('TalkedTo'), both('OrderedFrom')
I am missing something/? 

ale...@fiverr.com

unread,
Feb 28, 2015, 9:21:01 AM2/28/15
to orient-...@googlegroups.com
and also - this is not quite good i guess, since the difference will also give me users that just order one from another but did not talk to each other....


On Wednesday, February 25, 2015 at 2:32:14 PM UTC+2, ale...@fiverr.com wrote:

ale...@fiverr.com

unread,
Mar 1, 2015, 4:49:49 AM3/1/15
to orient-...@googlegroups.com
anyone? i'm kinda stuck with this....:/


On Wednesday, February 25, 2015 at 2:32:14 PM UTC+2, ale...@fiverr.com wrote:
Reply all
Reply to author
Forward
0 new messages