I'm using the new MongoDB Scala Driver. When I store a java.util.Date, it is being stored in MongoDB as an Int64 instead of a MongoDB Date. I have some code that looks like this:
implicit val writer = new Writes[Forecast] {
def writes(x: Forecast): JsValue = {
Json.obj(
// ...
"issueDateTime" -> x.issueDateTime // which is a java.util.Date
// ...
)
}
}
but what ends up in MongoDB is an Int64, not a Date. How do I get a Date into MongoDB?