使用play 2/scala,casbah和salat
abstract class BaseQuestion(val data:String,val responses:List[StudentResponse] = Nil){
val key:String = UUID.randomUUID().toString
}
case class Question(override val data:String, val questionType:String = "MCQ", val choices:List[String] = Nil,
val answer:String,override val responses:List[StudentResponse])
extends BaseQuestion(data = data,responses = responses)
但是,当我使用salatdao.save时,检查mongo数据库属性密钥未存储在mongo数据库对象中。
不确定问题是什么。
预先感谢您。
您需要用@Persist
key
https://github.com/novus/salat/wiki/annotations