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

Support for paths #66

Open
rnix opened this issue Feb 15, 2015 · 1 comment
Open

Support for paths #66

rnix opened this issue Feb 15, 2015 · 1 comment

Comments

@rnix
Copy link

rnix commented Feb 15, 2015

There appears to be no support for returning paths. I think adding such support will ease the lack of a traversal API. e.g. it would be great to do something like:

cq := `start node=node(1) match path=node-[*]->(endpoint :leaf) return node,path,endpoint`
type response struct {
    Node neoism.Node `json:"node"`
    Path neoism.Path `json:"path"`
    Endpoint neoism.Node `json:"endpoint"`
} // note: Node and Endpoint are redundant if Path worked

Effectively finding me all the paths from node 1 to any leaves. So a Path can be a struct with []*Relationships (or Rels) + the db fields. With that information, i'd easily be able to walk from Path[0].Start() to Path[-1].End().

disclaimer: i do understand that i can iterate from the node myself through node.Outgoing() recursively and it wouldn't be much difference, but being able to specify the structure of the expected path declaratively is the real win with Path support.

@jmcvetta
Copy link
Owner

Please feel free to submit a Pull Request with your suggested changes. Contributions are happily accepted!

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

No branches or pull requests

2 participants