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

Sort/Order By? #58

Open
matanshukry opened this issue May 19, 2019 · 2 comments
Open

Sort/Order By? #58

matanshukry opened this issue May 19, 2019 · 2 comments

Comments

@matanshukry
Copy link

I'm just trying to use Ferma now (together with OrientDB), and I'm trying to find a way to sort through a result. I think there's a way using the .traverse() method, but the documentation doesn't seem to have almost any examples or information for such a thing.

How can I do that?

@killje
Copy link
Contributor

killje commented Jun 5, 2019

Yes you would use .traverse() as follows

framedGraph.traverse(
    (GraphTraversalSource g) -> g.V().order().by("name")
).toList(YourVertex.class);

Note that you do not have to add GraphTraversalSource in a lambda expression, but I added this for clarity. This is a Tinkerpop class and to see the abilities like sorting you should check out the the Tinkerpop documentation: http://tinkerpop.apache.org/docs/3.3.2/reference/

The traverse function is a way to access the graph traversal build in, into Tinkerpop and gives the ability to frame the vertexes and edges to your own classes

@freemo
Copy link
Member

freemo commented Mar 6, 2020

@killje Thanks for your help on this. Reach out to me anytime if you'd like to get more involved into the project. Either way, appreciate you responding on this one.

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

No branches or pull requests

3 participants