本文介绍了方法"rel_length"被指定为"rel_length".在Neo4j.rb中不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要得到User的朋友的朋友".因此,friend(rel_length: 2)无效(忽略方法),返回了朋友.

I need to get "friends of friends" of User. So, friend(rel_length: 2) doesn't work (ignores method), returning friends.

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(请参见注释)

For anybody finding this later the reason was because he was using an older version of the gem (see the comments)

这篇关于方法"rel_length"被指定为"rel_length".在Neo4j.rb中不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 12:34