Questions tagged [neo4j.rb]

Neo4j.rb is an Active Model compliant Ruby/JRuby wrapper for the Neo4j graph database. It uses the neo4j-core and active_attr gems.

Neo4j.rb is an Active Model compliant Ruby/JRuby wrapper for the Neo4j graph database.

https://github.com/neo4jrb/neo4j

175 questions
1
vote
1 answer

Neo4j.rb How to use it with Rails

I am using neo4j version 3.X, I am using searchkick currently using User.search(params[:term], operator: 'or', fields: [:first_name, :last_name], misspellings: { below: 5 }, match: :word_start, page: params[:page], per_page:…
Vishal G
  • 1,521
  • 11
  • 30
1
vote
1 answer

How can i fix the constraints and indexes in neo4j for a changed record?

I changed the name of a record in neo4j. Now I'm getting an error that hints at a pending migration. class CreateOrganization < Neo4j::Migrations::Base def up execute("MATCH (n:Institution) SET n:Organization REMOVE n:Institution RETURN n") …
jesse lawson
  • 93
  • 2
  • 7
1
vote
2 answers

Neo4j.rb How to run Cypher query directly?

I want to run directly Cypher queries in rails don't want to use ORM style because I have long queries which I made on neo4j console and when I am trying to change into orm style its not behaving as expected MATCH (n {name:…
Vishal G
  • 1,521
  • 11
  • 30
1
vote
1 answer

Neo4j Active Node : how to use default_scope like active record?

Is there any way I can use default scope like active record? https://apidock.com/rails/ActiveRecord/Scoping/Default/ClassMethods/default_scope Or any other with which I can exclude nodes from any query?
Vishal G
  • 1,521
  • 11
  • 30
1
vote
2 answers

Duplicate edges with same properties neo4j

I have two nodes between which, same edge with same property is being created over and over again. How can I avoid this? If the edges have different properties, its ok and it needs to be kept but if the properties are same, there should be one edge…
vish4071
  • 5,135
  • 4
  • 35
  • 65
1
vote
1 answer

Neo4j inconsistent behaviour of model classes

I have created 5 models in my project using ActiveNode model and using neo4j gem. There is a model named Disease, defined as: class Disease include Neo4j::ActiveNode property :disease, type: String, constraint: :unique property…
vish4071
  • 5,135
  • 4
  • 35
  • 65
1
vote
1 answer

Rsepc - Database cleaner with Neo4j.rb 8.0.13

With Old version of neo4j & eno4j.rb everything was working good RSpec.configure do |config| config.before(:suite) do DatabaseCleaner.clean_with(:truncation) DatabaseCleaner[:neo4j, connection: { type: :server_db, path:…
Vishal G
  • 1,521
  • 11
  • 30
1
vote
1 answer

undefined method `rels` for #

Recently I upgraded to Neo4j 3.1.3, Neo4j.rb 8.0.13, and Neo4j-core 7.1.2. Since then, rels method throws undefined method 'rels' for # error. My query is, student.rels(dir: :outgoing, type: :enrolled_in).count Along with…
Ji You
  • 23
  • 3
1
vote
1 answer

neo4j RuntimeError: No session defined

class Client =begin Clients are individual users =end include Neo4j::ActiveNode include Neo4j::UndeclaredProperties include Neo4j::Timestamps # will give model created_at and updated_at timestamps property :bot_client_id property :sms …
Satchel
  • 16,414
  • 23
  • 106
  • 192
1
vote
1 answer

Sidekiq Broken Pipe Error

I am attempting to migrate from Heroku to AWS, but my Sidekiq jobs keep failing with the following error: Errno::EPIPE: Broken pipe @ io_write - I can successfully run jobs from the console using perform_now, and everything works just fine…
Andy Weiss
  • 405
  • 5
  • 15
1
vote
1 answer

Neo4jrb 8.x- Cypher query issues

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 …
easteregg
  • 149
  • 9
1
vote
1 answer

How can I get all ActiveRel between two ActiveNode in Neo4j ruby?

Suppose we have Node: User name : String Rel: Transaction amount : Float representing a simplized Bitcoin-like transaction, where a User sends coins to other Users. A Transaction has a property amount which shows how much coin you're sending…
Todoroki
  • 515
  • 4
  • 12
1
vote
2 answers

Searchkick neo4j: search not working?

I have used gem searchkick & gem neo4j class User include Neo4j::ActiveNode property :first_name property :last_name property :email searchkick callbacks: :async def search_data { first_name: first_name, last_name:…
Vishal G
  • 1,521
  • 11
  • 30
1
vote
1 answer

Neo4j and Ruby/Rails: How to only return nodes based on user permissions

How to return an index of only Items where the User has permission? How to return an index of only Items where the Group a User is in has permission? How to return a single item only if a User has permission? How to return a single item only if the…
joshfindit
  • 611
  • 6
  • 27
1
vote
1 answer

Neo4j.rb How to make one query when filtering parameter may or may not be present?

User and Place are the two nodes having has_many realtionship @places = User.find(4).places @places = @places.where(dog: false) if params[:no_dogs] can I make these two into one so that if param comes then it involve where condition other wise…
Vishal G
  • 1,521
  • 11
  • 30