Neo4jrb - NameError: uninitialized constant Neo4j::ActiveNode::Query::QueryProxy::ANSI
Neo4jrb - NameError: uninitialized constant Neo4j::ActiveNode::Query::QueryProxy::ANSI
我正在找作家阿尔贝·加缪。
对于这位作者,我想检索他创作的所有艺术作品(他写的书)。但是我收到错误 "NameError"。详情如下:
Loading development environment (Rails 4.2.1)
irb(main):001:0> a = Author.find_by(author_name: 'Camus, Albert')
CYPHER 1947ms MATCH (n:`Author`) WHERE (n.author_name = {n_author_name}) RETURN n LIMIT {limit_1} | {:n_author_name=>"Camus, Albert", :limit_1=>1}
=> #<Author uuid: "c48667c1-3c6e-11e5-8eb8-22000b18b199", author_name: "Camus, Albert">
irb(main):002:0> wa = a.wokas
NameError: uninitialized constant Neo4j::ActiveNode::Query::QueryProxy::ANSI
from /Users/levi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/neo4j-5.0.13/lib/neo4j/active_node/query/query_proxy.rb:54:in `inspect'
我正在做的第二次尝试:
irb(main):011:0* wa = a.wokas.to_a
Author#wokas 1500ms MATCH author20415116 WHERE (ID(author20415116) = {ID_author20415116}) MATCH author20415116-[rel1:`AUTHORED_BY`]->(result_wokas:`Woka`) RETURN result_wokas | {:ID_author20415116=>20415116}
=> [#<Woka uuid: "3fa18fd6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Postoronnij">, #<Woka uuid: "3ea359b6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Chute / CD MP3, La">, #<Woka uuid: "335621a3-3c6e-11e5-8eb8-22000b18b199", woka_title: "First Man, The">, #<Woka uuid: "1a5d763c-3c6e-11e5-8eb8-22000b18b199", woka_title: "Caligula and Three Other Plays">, ...
然后它就开始工作了,没有转换成数组:
irb(main):017:0* wa = a.wokas
=> [#<Woka uuid: "3fa18fd6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Postoronnij">, #<Woka uuid: "3ea359b6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Chute / CD MP3, La">, #<Woka uuid: "335621a3-3c6e-11e5-8eb8-22000b18b199", woka_title: "First Man, The">, #<Woka uuid: "1a5d763c-3c6e-11e5-8eb8-22000b18b199", woka_title: "Caligula and Three Other Plays">, #<Woka uuid: "ed76dd0d-3c6d-11e5-8eb8-22000b18b199", woka_title: "Exile and the Kingdom">, ...
更多详情:
irb(main):013:0* wa.count
=> 223
irb(main):014:0> wa.class
=> Neo4j::ActiveNode::HasN::AssociationProxy
irb(main):015:0>
这是我的 类:
class Author
include Neo4j::ActiveNode
property :author_name, type: String
has_many :out, :wokas, model_class: Woka, type: 'AUTHORED_BY'
end
class Woka
include Neo4j::ActiveNode
property :woka_title, type: String
has_many :in, :authors, model_class: Author, type: 'AUTHORED_BY'
has_one :in, :publisher, model_class: Publisher, type: 'PUBLISHED_BY'
has_many :out, :bisacs, model_class: Bisac, type: 'INCLUDED_IN'
has_one :in, :language, model_class: Language, type: 'PUBLISHED_IN'
has_many :out, :descriptions, model_class: Description, type: 'DESCRIBED_BY'
end
这里有什么问题?
在用 cypher 测试关系时,一切正常。
已通过升级到:
neo4j (5.0.14)
neo4j-核心 (5.0.10)
我正在找作家阿尔贝·加缪。 对于这位作者,我想检索他创作的所有艺术作品(他写的书)。但是我收到错误 "NameError"。详情如下:
Loading development environment (Rails 4.2.1)
irb(main):001:0> a = Author.find_by(author_name: 'Camus, Albert')
CYPHER 1947ms MATCH (n:`Author`) WHERE (n.author_name = {n_author_name}) RETURN n LIMIT {limit_1} | {:n_author_name=>"Camus, Albert", :limit_1=>1}
=> #<Author uuid: "c48667c1-3c6e-11e5-8eb8-22000b18b199", author_name: "Camus, Albert">
irb(main):002:0> wa = a.wokas
NameError: uninitialized constant Neo4j::ActiveNode::Query::QueryProxy::ANSI
from /Users/levi/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/neo4j-5.0.13/lib/neo4j/active_node/query/query_proxy.rb:54:in `inspect'
我正在做的第二次尝试:
irb(main):011:0* wa = a.wokas.to_a
Author#wokas 1500ms MATCH author20415116 WHERE (ID(author20415116) = {ID_author20415116}) MATCH author20415116-[rel1:`AUTHORED_BY`]->(result_wokas:`Woka`) RETURN result_wokas | {:ID_author20415116=>20415116}
=> [#<Woka uuid: "3fa18fd6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Postoronnij">, #<Woka uuid: "3ea359b6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Chute / CD MP3, La">, #<Woka uuid: "335621a3-3c6e-11e5-8eb8-22000b18b199", woka_title: "First Man, The">, #<Woka uuid: "1a5d763c-3c6e-11e5-8eb8-22000b18b199", woka_title: "Caligula and Three Other Plays">, ...
然后它就开始工作了,没有转换成数组:
irb(main):017:0* wa = a.wokas
=> [#<Woka uuid: "3fa18fd6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Postoronnij">, #<Woka uuid: "3ea359b6-3c6e-11e5-8eb8-22000b18b199", woka_title: "Chute / CD MP3, La">, #<Woka uuid: "335621a3-3c6e-11e5-8eb8-22000b18b199", woka_title: "First Man, The">, #<Woka uuid: "1a5d763c-3c6e-11e5-8eb8-22000b18b199", woka_title: "Caligula and Three Other Plays">, #<Woka uuid: "ed76dd0d-3c6d-11e5-8eb8-22000b18b199", woka_title: "Exile and the Kingdom">, ...
更多详情:
irb(main):013:0* wa.count
=> 223
irb(main):014:0> wa.class
=> Neo4j::ActiveNode::HasN::AssociationProxy
irb(main):015:0>
这是我的 类:
class Author
include Neo4j::ActiveNode
property :author_name, type: String
has_many :out, :wokas, model_class: Woka, type: 'AUTHORED_BY'
end
class Woka
include Neo4j::ActiveNode
property :woka_title, type: String
has_many :in, :authors, model_class: Author, type: 'AUTHORED_BY'
has_one :in, :publisher, model_class: Publisher, type: 'PUBLISHED_BY'
has_many :out, :bisacs, model_class: Bisac, type: 'INCLUDED_IN'
has_one :in, :language, model_class: Language, type: 'PUBLISHED_IN'
has_many :out, :descriptions, model_class: Description, type: 'DESCRIBED_BY'
end
这里有什么问题? 在用 cypher 测试关系时,一切正常。
已通过升级到: neo4j (5.0.14) neo4j-核心 (5.0.10)