zella
zella

Reputation: 4685

How to find joint friends of users

I have a Users with friends:

User {
    "@rid:": "#11:2"
    ...
    friends: ["#61:1", "#61:2", "#61:3"]
}
...


User {
    "@rid:": "#11:3"
    ...
    friends: ["#61:2", "#61:3","#61:4"]
}

How i can to find joint friends of users ("#11:2", "#11:3") with osql?

So query should return "#61:2", "#61:3".

Upvotes: 1

Views: 57

Answers (1)

Michela Bonizzi
Michela Bonizzi

Reputation: 2632

Try this:

select from User where @rid in (select out() from User where @rid = "#11:2") and @rid in (select out() from User where @rid = "#11:3")

Hope it helps

Regards

Upvotes: 2

Related Questions