longevity

A Persistence Framework for Scala and NoSQL

View project on GitHub

repo.delete

Use Repo.delete to remove a persistent object from the database:

val userState: PState[User] = getUserState()
val deleteResult: Future[Deleted[User]] = userRepo.delete(userState)

The delete is complete when the future completes successfully. You cannot do much with the Deleted, but you can have at the persisent object for old times sake:

deleteResult map { deleted =>
  val deletedUser: User = deleted.get
}

Of course, this value will not be particularly useful, as the persisent object no longer exists.

We would like to support in-database deletes in the future, possibly with something like Repo.deleteByQuery or Repo.deleteByKeyVal.
prev: repo.update
up: repositories
next: polymorphic repositories