Neo4j.rb 中的方法 "rel_length" 无效。
Method "rel_length" in Neo4j.rb doesn't work.
我需要 "friends of friends" 个 User
。所以,friend(rel_length: 2)
不起作用(忽略方法),返回朋友。
class User
include Neo4j::ActiveNode
...
has_many :out, :friend, rel_class: Friend
...
end
class Friend
include Neo4j::ActiveRel
from_class User
to_class User
type 'friend'
property :activity, type: String
property :relation, type: String
property :token, type: String
end
对于后来发现此问题的任何人,原因是因为他使用的是 gem 的旧版本(请参阅评论)
我需要 "friends of friends" 个 User
。所以,friend(rel_length: 2)
不起作用(忽略方法),返回朋友。
class User
include Neo4j::ActiveNode
...
has_many :out, :friend, rel_class: Friend
...
end
class Friend
include Neo4j::ActiveRel
from_class User
to_class User
type 'friend'
property :activity, type: String
property :relation, type: String
property :token, type: String
end
对于后来发现此问题的任何人,原因是因为他使用的是 gem 的旧版本(请参阅评论)