1

I am working on a login process using the Play framework and Scala and I am getting the following error:

No Json serializer as JsObject found for type play.api.libs.json.JsValue. Try to implement an implicit OWrites or OFormat for this type

Here is my model code. What am I doing wrong?

def checkUser(user: Signin): Future[Option[Signin]] = {
  val query = BSONDocument("_email" -> user.email, "password" -> user.password)
  collection.flatMap(_.find(query).requireOne[Signin])
}
Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
amit
  • 1
  • 1
  • 18
  • 28
  • Which mongo driver are you using? I don't see any use of `play.api.libs.json.JsValue`. It seems that your problem is somewhere else and not in the code which you shared. – sarveshseri Jan 24 '18 at 08:23
  • 3
    Possible duplicate of [No Json serializer as JsObject found for type play.api.libs.json.JsObject](https://stackoverflow.com/questions/31142366/no-json-serializer-as-jsobject-found-for-type-play-api-libs-json-jsobject) – cchantep Jan 24 '18 at 09:50

0 Answers0