I have a case class who's one of the properties if of type JValue
.
During serialization, it gets converted to BasicDBList
(regardless of what was it's value, even it if was just a JString
- this is odd, but set that aside...)
So saving the object to the database (Mongodb) works fine, but when I try to findOne()
, I'm getting the following error:
argument type mismatch
$anon$2(class com.example.data.Telemetry @ com.novus.salat.global.package$$anon$1@7376d6c3) toObject failed on:
SYM: com.example.data.Telemetry
CONSTRUCTOR
public com.example.data.Telemetry(java.lang.String,org.json4s.JsonAST$JValue)
---------- CONSTRUCTOR EXPECTS FOR PARAM [1] --------------
NAME: location
TYPE: org.json4s.JsonAST$JValue
DEFAULT ARG [Missing, but unnecessary because input value was supplied]
@Ignore false
---------- CONSTRUCTOR INPUT ------------------------
TYPE: com.mongodb.BasicDBList
VALUE:
[ [ [ "latitude" , [ 34.001]] , [ "longitude" , [ 32.511]]]]
------------------------------------------------------------
So it seems like the object does not get deserialized properly (from BasicDBList
back to JValue
). This works fine one what, but the other way seems broken.
Am I missing something?