【发布时间】:2018-10-30 13:21:24
【问题描述】:
我需要将现有的 Play + Scala + Mongodb 应用程序转换为 Lagom 微服务。但我测试过的所有例子都是使用 Cassadra。
如其文档中所述,对 mongodb 有读取支持。 There is plugin too.
这意味着,我们可以不写入 mongodb 集合吗?
【问题讨论】:
标签: mongodb playframework-2.6 lagom
我需要将现有的 Play + Scala + Mongodb 应用程序转换为 Lagom 微服务。但我测试过的所有例子都是使用 Cassadra。
如其文档中所述,对 mongodb 有读取支持。 There is plugin too.
这意味着,我们可以不写入 mongodb 集合吗?
【问题讨论】:
标签: mongodb playframework-2.6 lagom
是的,您理论上可以创建 MongoDB 持久性 API。你需要实现:
com.lightbend.lagom.scaladsl.persistence.{
PersistenceComponents,
PersistentEntityRegistry,
ReadSidePersistenceComponents,
WriteSidePersistenceComponents
}
和play.api.db.DBComponents。
您可以查看 JDBC 的示例实现 here。
【讨论】: