arangodb/spring-data

Delete all edges on deleting a document

alxxyz opened this issue · 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");

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

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