Answer the question
In order to leave comments, you need to log in
Why is rel_length in neo4jrb not working?
There is a User class.
class User
include Neo4j::ActiveNode
...
has_many :out, :friend, rel_class: Friend
...
end
Users communicate through friend
class Friend
include Neo4j::ActiveRel
from_class User
to_class User
type 'friend'
end Retrieve
all friends of friends current user.
Next line: @user.friend(:f, :r, rel_length:2).pluck(:f) returns the friends of the current user. And you need friends of friends. Moreover, instead of rel_length:2, you can write any key:value pair. Even abracadabra. It seems to ignore this third parameter.
@user.friend.friend(:f).where("f.user_id <> '#{@user.user_id}'").pluck(:f)
So far I've only found this solution, but it seems to me that it's not quite optimal solution.
Who faced, prompt please.
Answer the question
In order to leave comments, you need to log in
This will not work in any normal social network + browser security settings will make themselves felt. Although in the same VK you can do a tricky trick with click junking and repost on behalf of the user
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question