I\'m using Spring Data with MongoDB using MongoRepository.
I was wondering if it is possible do a delete by filter using query annotation. I have been looking here and g
Try this, it's work for me.
@Repository public interface DepartmentDao extends MongoRepository { @DeleteQuery void deleteByDepartment(String department); }
OR
@Query(value="{'_id' : ?0}", delete = true) public void deleteById(String id);