1

I have a case class with an attribute of type Map[String, Map[String, Int]]. When retrieving the corresponding record from Mongodb, the map is deserialized as Map[String, DbObject].

The exception : Caused by: java.lang.ClassCastException: com.mongodb.BasicDBObject cannot be cast to scala.collection.MapLike

I tried to hook my own deserializer to the context but it seems it is not taken into account. How can I deal with such deserialisation issue ?

I am using Salat 1.9.9 and Casbah 2.7.1

Louis F.
  • 2,018
  • 19
  • 22
  • An unrelated note: the project is not being maintained anymore: https://github.com/leon/play-salat . Probably consider using other libraries like reactivemongo? – Max Jan 02 '16 at 14:31
  • Hello @Max, I am not using the plugin for Play ! So I guess it's totally unrelated ! – Louis F. Jan 02 '16 at 15:02
  • Hello, what do you mean by "I tried to hook my own deserializer to the context but it seems it is not taken into account." Can you add more detail to the question? – noahlz Sep 07 '16 at 16:29
  • Also: nested Maps are not currently supported in Salat. https://github.com/salat/salat/wiki/SupportedTypes – noahlz Sep 07 '16 at 16:30

0 Answers0