0

MongoDBとReactiveMongoを使用してplay2.1アプリケーションを作成しようとしています。私のモデルの1つには、外部ライブラリのメンバーがあります(具体的には、SecureSocialのuseridとpasswordinfoですが、一般的には)。私の質問は-どのBSONタイプの下にそれらを保存しますか?

case class User{
    firstName: String, 
    lastName: String,
    authMethod: AuthenticationMethod,
    avatarUrl: Option[String] = None, 
    oAuth1Info: Option[OAuth1Info] = None,
    oAuth2Info: Option[OAuth2Info] = None,
}

  implicit object UserBSONReader extends BSONReader[User] {
    def fromBSON(document: BSONDocument) :Role = {
      val doc = document.toTraversable
      User(
        doc.getAs[BSONObjectID]("_id"),
        doc.getAs[BSONString]("email").get.value,
        doc.getAs[**?????????**]("passwordInfo").get.value,
        doc.getAs[BSONString]("firstName").get.value,
        doc.getAs[BSONString]("lastName").get.value,
        doc.getAs[**?????????**]("authMethod").get.value,

..。

4

0 に答える 0