-
Notifications
You must be signed in to change notification settings - Fork 135
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
Create a path #22
Comments
Documentation is indeed lacking -- sincere apologies. There's an issue open for better documentation: #6. To get the shortest path from node1 to node3, use the Node.prototype.path = function (toNode, relType, relDirection, maxDepth=1, algorithm='shortestPath', callback) {
...
} At the moment, even though we have default values for So your code is close; here it is corrected: // get the path from barcelona to reus
bcn.path(reus, 'goes', 'out', 3, null /* for shortest path */, function(err, path) {
...
}); Note that I corrected "from reus to barcelona" to "from barcelona to reus", as your data has the relationships going from barcelona to reus. If you really do want to get the path backwards, you can switch Hope that helps. Sorry again for the lack of documentation, and thanks for bringing it up. |
Btw, in general, we aren't focusing on these REST API methods much anymore, since you can achieve them with Cypher queries now. Cypher is both much simpler and much more powerful at letting you express exactly what you want. (E.g. for shortest paths.) But I see now that our Cypher wrapper doesn't properly handle returned paths. (Sorry, we only ever return nodes, rels and properties, so we never realized this.) I'll leave this issue open to support paths in our Cypher wrapper. When we add this support, I'll post back here. Thanks. |
I see. I take a eye on the cypher doc. Thanks for all ;) And yes, we are working on a path-finding app so we really need that paths. Thanks again for the quickly response. |
Okay, added a test, fixed the code, and now indeed you can return paths in Cypher queries! |
Published to npm as v0.2.15. |
I'm really confused with this lib.
Maybe is due of the lack of doc..
I was checking the codes and i don't come with the answer.
I have 3 nodes
And 2 relationships
node1->node2
node2->node3
I want to get the best path from node1 to node3
But i don't know how to create a path and how to use it....
Any help?
I see a lot of nice methods in neo4j for finding best paths but seems to don't be implemented here?
My actual code can be reviewed in https://github.com/naxhh/playground/blob/master/neo4j/app.js
The text was updated successfully, but these errors were encountered: