问题标签 [reactivemongo-play-json]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
scala - ReactiveMongo 与 Play-json 职责的划分
我正在使用 play-json 将传入的 json 序列化为案例类,例如来自 sqs 源或来自 api 调用。
它是一个非常简单的 JsonSerialization 类,我在需要的地方导入它:
但现在我想知道,根据我对 Dao 的理解,需要将我的案例类序列化为 BSON ,因为我的 Dao 获取了案例类,并且当我从某些东西中获取反序列化到我的案例类时。我只在 Dao 中导入:
并找到并插入完美的作品,
你能告诉我道中哪个部分负责什么吗?我有点困惑
抱歉,如果这是一个初学者问题,但得到简短的解释会很有帮助
mongodb - 如何使用 ReactiveMongo + Play Json 将日期/时间存储到 mongodb
我正在尝试以java.time.Instant
mongo 的本机Date
格式存储。
官方 ReactiveMongo 文档指出日期时间应序列化为
(http://reactivemongo.org/releases/1.0/documentation/json/overview.html)
我遵循此规则,但该值不存储为 mongo's Date
,而是存储为常规 JSON (BSON) 文档:
存储文档的 Scala 源代码:
这里有什么问题?
PS:
如果我更改扩展 BSON 语法
至 BSONDateTime
:
有用。
但是,为什么它不能与 play JSON + 扩展语法一起使用?