我是mongodb的新手,也是反应性的mongo,我正在尝试将此示例集成到我的项目中https://github.com/sgodbillon/reactivemongo-demo-app 首先,我想只使用类文章,但是当我集成模型和控制器时,我得到了这个错误:
No Json serializer as JsObject found for type play.api.libs.json.JsObject. Try to implement an implicit OWrites or OFormat for this type.
控制器中的这一行:
63 // the cursor of documents
64 val found = collection.find(query).cursor[Article]
答案 0 :(得分:0)
您是否实施了Article
的写入?
简单的宏必须帮助你
implicit val articleWrite = Json.writes[Article]