neo4j-cypher icon indicating copy to clipboard operation
neo4j-cypher copied to clipboard

Neo4j::Cypher.query not accepting do end block

Open OpenCoderX opened this issue 11 years ago • 0 comments

When I run this code:

require "rubygems"
require "active_attr"
require "neography"
require "json"
require "neo4j-cypher"
require "neo4j-cypher/neography"

puts Neo4j::Cypher.query do
  node(1).outgoing(rel(:friends).where{|r| r[:since] == 1994})
end

I get this error:

/home/chris/.rvm/gems/ruby-2.0.0-p247/gems/neo4j-cypher-1.0.2/lib/neo4j-cypher/root.rb:11:in `instance_exec': no block given (LocalJumpError)
    from /home/chris/.rvm/gems/ruby-2.0.0-p247/gems/neo4j-cypher-1.0.2/lib/neo4j-cypher/root.rb:11:in `execute'
    from /home/chris/.rvm/gems/ruby-2.0.0-p247/gems/neo4j-cypher-1.0.2/lib/neo4j-cypher/result.rb:27:in `initialize'
    from /home/chris/.rvm/gems/ruby-2.0.0-p247/gems/neo4j-cypher-1.0.2/lib/neo4j-cypher.rb:45:in `new'
    from /home/chris/.rvm/gems/ruby-2.0.0-p247/gems/neo4j-cypher-1.0.2/lib/neo4j-cypher.rb:45:in `query'
    from graph.rb:157:in `<main>

But when I change the do end block to use { } block syntax the code works fine.

The docs here led me to believe this syntax should be possible: https://github.com/andreasronge/neo4j/wiki/Neo4j%3A%3ACypher-API

OpenCoderX avatar Feb 05 '14 22:02 OpenCoderX