included do
around_action :wrap_in_session_or_transaction
end
def wrap_in_session_or_transaction
ActiveGraph::Base.session(bookmarks: transaction_bookmarks) do
wrap_in_transaction? ? ActiveGraph::Base.send(transaction_method) { yield } : yield
end
@last_bookmark = serialize_bk(ActiveGraph::Base.last_bookmark)
auth_token_headers
end
transaction_method
is read_transaction
or write_transaction
. You need to specify this correctly to get the full benefit of causal cluster.
Hi. We have an array field in our nodes and I want to search by this field.
If I do Node.where(ar: [1, 2, 3])
the query is ... WHERE n.ar IN $ar...
, how can I use the equality operator =
instead of IN
?
I tried making a custom type with a custom converter where to_db
returned an array, but even then the query used IN
but not =
.
Anyone else using Neo4j Aura with ActiveGraph? I got an email today saying:
"It seem you are using a Ruby driver (we believe via http://neo4jrb.io/ ) to connect to Aura and as you know unfortunately this driver is not part of the official Neo4j supported drivers certified to work well with Aura.
Note that this driver https://github.com/neo4jrb/activegraph#neo4j-version-support states that support for 4.1 and above are not supported and since Aura is running 4.2+ this is indeed an issue."
Anyone else got this?
In our project we faced some random freezes and decided to try jruby with neo4j-java-driver.
In the dev environment we use docker-compose with the Rails app and Neo4j 3.5 running in different containers.
In config/neo4j.yml
I have
development:
url: bolt://docker_neo4j:7687
username: neo4j
password: password
But I get
Invalid address format `bolt://docker_neo4j:7687`
/usr/local/bundle/gems/neo4j-java-driver-1.7.4-java/jruby/neo4j/driver/ext/exception_checkable.rb:18:in `check'
/usr/local/bundle/gems/neo4j-java-driver-1.7.4-java/jruby/neo4j/driver/ext/graph_database.rb:14:in `driver'
/usr/local/bundle/gems/neo4j-java-driver-1.7.4-java/lib/neo4j/driver/auto_closable.rb:16:in `block in driver'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/railtie.rb:75:in `setup!'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/railtie.rb:53:in `block in Railtie'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:29:in `establish_driver'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:19:in `driver'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/transactions.rb:37:in `send_transaction'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/transactions.rb:21:in `transaction'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:33:in `query'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/core/schema.rb:20:in `constraints'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/model_schema.rb:35:in `model_constraints'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/model_schema.rb:131:in `each_schema_element'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/model_schema.rb:94:in `validate_model_schema!'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:73:in `validate_model_schema!'
/usr/local/bundle/gems/activegraph-10.1.0/lib/active_graph/base.rb:50:in `new_query'
This was working on MRI with neo4j-ruby-driver.
Interestingly, bolt://localhost:7687
works.
I tried bolt://neo4j:password@docker_neo4j:7687
and neo4j://docker_neo4j:7687
, but they also give the same error
.where(name: params[:name]) # safe
.where(“n.name = #{params[:name]}”) # cypher injection potential
.where('n.name = $name’, name: params[:name]) # safe
.match(params[:cypher_fragment]) # cypher injection potential
.where(name: params[:name]) # safe
.where(“n.name = #{params[:name]}”) # cypher injection potential
.where('n.name = $name’, name: params[:name]) # safe
.match(params[:cypher_fragment]) # cypher injection potential
rake neo4j:install[community-4.0.6]
but i changed to rake neo4j:install[community-latest,development]
as i've seen in other pagesInstall Neo4j (development environment)...
Retrieving latest version...
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - https://raw.githubusercontent.com/neo4jrb/neo4j-rake_tasks/master/neo4j_versions.yml
Tasks: TOP => neo4j:install
(See full trace by running task with --trace)
wget https://raw.githubusercontent.com/neo4jrb/neo4j-rake_tasks/master/neo4j_versions.yml
wget http://dist.neo4j.org/neo4j-community-4.1.8-unix.tar.gz