Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neo4j::Cypher.query not accepting do end block #11

Open
OpenCoderX opened this issue Feb 5, 2014 · 0 comments
Open

Neo4j::Cypher.query not accepting do end block #11

OpenCoderX opened this issue Feb 5, 2014 · 0 comments

Comments

@OpenCoderX
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant