[ 
https://issues.apache.org/jira/browse/TINKERPOP-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17933131#comment-17933131
 ] 

Cole Greer commented on TINKERPOP-2520:
---------------------------------------

Since this JIRA was opened, the reverse() step has been added: 
https://tinkerpop.apache.org/docs/3.7.3/reference/#reverse-step

This generally covers the behaviour described here, and it will be able to 
reverse a path, the only caveat is the output will always be a list. I am going 
to close this for now. Feel free to reopen if there is a desire to somehow 
retain the path type through reversal.

> Add the ability to reverse the stream or a collection
> -----------------------------------------------------
>
>                 Key: TINKERPOP-2520
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2520
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.4.10
>            Reporter: Kelvin R. Lawrence
>            Priority: Minor
>              Labels: breaking
>
> I had a Gremlin user ask me yesterday if there was a way to have the results 
> of a `path` step be reversed. Today you cannot do that using `from` and `to` 
> steps as the `from` label must appear before the `to` label in a path. In 
> thinking about this, perhaps adding a `reverse` option to order (on top of 
> `asc`,`desc` and `shuffle`) would be a nice addition to Gremlin. So you could 
> write something like:
> {code:java}
> g.V().out().out().path().order(local).by(reverse){code}
> For this specific user they were union-ing a set of paths in different 
> directions and wanted to normalize them to all be in the same direction when 
> presented as results.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to