0

I have this cypher query of

match p= (START:Task {name: 'Start'})-[*]->(finish:Task {name: 'C'})  return p

and would like to make the related active model query using neo4jrb.

nigelr
  • 391
  • 4
  • 7

1 Answers1

0

Without more information:

Neo4j::ActiveBase.query("match p= (START:Task {name: 'Start'})-[*]->(finish:Task {name: 'C'}) return p").pluck(:p)

I'm not sure what you mean by "related active model query", but if Task is a ActiveNode model you could also do

Task.query_as(:t).match("p=(t {name: 'Start'})-[*]->(:Task {name: 'C'})").pluck(:p)

But I think the first version is clearer. In both cases you're returning a Neo4j::Core::Path object.

John
  • 9,249
  • 5
  • 44
  • 76