1

I am using a rails app with neo4j database, recently I had updated Neo4j server from v 2.x to 3.x and the gem neo4j from 7.x to 8.x . Having these models in my app:

class Country
  include Neo4j::ActiveNode

  property :summary, type: String
  property :code, type: String

  has_many :out, :provinces, type: :placed, model_class: :Province
end

class Province
  include Neo4j::ActiveNode

  property :summary, type: String
  property :code, type: String

  has_one :in, :country, type: :placed, model_class: :Country
end

when I try to do a query in this way:

Neo4j::Core::Query.new.match(p: Province, c: Country).match("(c)-[PLACED]->(p)").order_by('p.summary').return(:p).pluck(:p)

I retrieve this error:

 Neo4j::Core::Query.new.match(p: Province, c: Country).match("(c)-[PLACED]->(p)").order_by('p.summary').return(:p).pluck(:p)
NoMethodError: undefined method `_query' for nil:NilClass

and in the same way for the other similar queries performed by Neo4j::Core::Query class.

What i am doing wrong?

easteregg
  • 149
  • 9

1 Answers1

0

The neo4j-core API has changed in the latest versions of the gems. You should check out the upgrade guide:

http://neo4jrb.readthedocs.io/en/8.0.x/UpgradeGuide.html

Brian Underwood
  • 10,746
  • 1
  • 22
  • 34