Closed angelacode closed 7 years ago
The tests are probably a better resource for examples than the documentation. See https://github.com/maxdemarzi/neography/blob/master/spec/integration/node_relationship_spec.rb for example.
Thanks. I saw this approach for getting the nodes via relationships in the documentation but I was different from the session created using the Neographh::Rest.new. How do I authorize Neography::Node? In other words, I created an @neo session using the URL to my grapheneDB but don't see a way to authorize the same session using the Phase 2 and so don't have a connection.
Is there a way using the REST wrapper to get node relationships?
Hope that makes sense. Thank you for being so fast with your answers. I really love this gem.
I am not able to execute the code in either the tests or the documentation:
a = Neography::Node.create Excon::Error::Socket: Connection refused - connect(2) for 127.0.0.1:7474 (Errno::ECONNREFUSED)
I successfully created an @neo
session as described, but from the error, it looks like it still thinks the server is localhost when using Neography::Node
I configured it as follows and seems to work better but wasn't clear from the REST API session documentation.
` Configure Neography as follows:
Neography.configure do |config| config.protocol = "http" config.server = "localhost" config.port = 7474 config.directory = "" # prefix this path with '/' config.cypher_path = "/cypher" config.gremlin_path = "/ext/GremlinPlugin/graphdb/execute_script" config.log_file = "neography.log" config.log_enabled = false config.slow_log_threshold = 0 # time in ms for query logging config.max_threads = 20 config.authentication = nil # 'basic' or 'digest' config.username = nil config.password = nil config.parser = MultiJsonParser config.http_send_timeout = 1200 config.http_receive_timeout = 1200 config.persistent = true end `
Neography was written at a time when Neo4j had no authentication. Nowadays you have to change the default password before you are able to do anything, so once you do that and configure you are good to go. The REST API is not the way forward for writing Neo4j apps. You really have 2 choices. Learn Cypher and send cypher queries via rest/bolt.... Or learn the Neo4j Java API and use Unmanaged Extensions. See https://maxdemarzi.com/2017/03/30/building-a-twitter-clone-with-neo4j-part-one/ for the latter.
Why is the REST API not the way to write apps?
If I could solve, for example, retrieving a relationships for a node, I could do what I need to do:
Hi, I am going through the documentation in the REST api. For a given node = node1, I want to discover what the nodes are that are related.
I can find the relationships. But for a given relationships, I can't find the node.
It looks like something I could do based on the documentation for "Phase 2" but when I type the code as listed for creating I get a connection refused error.
I also am not clear on the difference between the first part of the documentation and "Phase 2". Thanks.