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

Delete all edges on deleting a document

Open alxxyz opened this issue 2 years ago • 2 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;
}

public interface UsersRepository extends ArangoRepository<User, String> {
}

On deleting user to delete also all edges

userRepository.deleteById("some-id");

alxxyz avatar May 11 '22 09:05 alxxyz

This is currently not supported. To work around it you can manually remove the edges with a custom AQL query.

rashtao avatar May 12 '22 10:05 rashtao

As there may be various edge types related to a document this is not trivial. But this is a feature of Named Graphs!

aburmeis avatar Aug 02 '23 09:08 aburmeis