Created
September 24, 2017 10:18
-
-
Save charmygarg/606df1e138c7e57a029cc6995d33800a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getAllUsers: Future[List[User]] = { | |
select | |
.fetch() | |
} | |
def getByid(id: String): Future[Option[String]] = { | |
select(_.name) | |
.where(_.id eqs id) | |
.allowFiltering() | |
.one() | |
} | |
def getByQuery(email: String, name: String): Future[Option[(String, Set[String])]] = { | |
select(_.id, _.email) | |
.where(_.email contains email) | |
.and(_.name eqs name) | |
.allowFiltering() | |
.one() | |
} | |
def getByidAndName(id: String): Future[List[User]] = { | |
update | |
.where(_.id eqs id) | |
.modify(_.name setTo "newUser") | |
.future() | |
getAllUsers | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment