spring-data icon indicating copy to clipboard operation
spring-data copied to clipboard

[DE-804] Feature: support edge any direction in derived queries

Open alxxyz opened this issue 2 years ago • 1 comments

@Document
public class User {
    @Id
    private String id;
     
    private String name;
}

@Edge
public class Friend {
    @Id
    private String id;

    @From
    private User user1;

    @To
    private User user2;
}

Supposing I have only user ID, how to write derived query to retrieve the list of friends? User ID can be used for both user1 or user2.

alxxyz avatar Apr 22 '22 12:04 alxxyz

This is currently not supported. To work around it you can write a custom AQL query performing a traversal of depth 1 in any direction and use it from @Query annotation.

Ref: https://www.arangodb.com/docs/stable/aql/graphs-traversals.html https://www.arangodb.com/docs/stable/drivers/spring-data-reference-repositories-queries.html#aql-query-options

rashtao avatar May 10 '22 10:05 rashtao