TASK: Get random friend suggestions from User
collection.
This is a User collection example:
{
"firstname": "John",
"lastname": "Doe",
"username": "johndoe",
"email": "[email protected]"
}
I also have an edge collection friendRequest
that stores friend requests like this:
_from: "User/John" -> _to: "User/Jane"
PROBLEM: I want to filter out my self and Users I already sent a request to.
This is my initial query to get 3 users excluding myself
FOR user IN User
FILTER user._key != 'myself'
SORT RAND()
LIMIT 3
RETURN user
I want to be able to exclude people I've already sent a request to using something like FILTER NOT IN (<<SOME EDGE QUERY>>)
NOTE: I also have a graph friendRequest_graph
that relates friendRequest
edge between User
collections