Executing find() on a MongoCollection[ModelDocument] results in ClassCastException if the ModelDocument contains a parameter of Set datatype (that also seems to extend to a scala.immutable.Map, and not necessarily for just the immutable types)
Please find the test file attached, to reproduce the error (Changes needed w.r.t specifying the MongoDb host and database/collection names.
It seems the decode() method in MacroCodec.scala is unable to create an instance of the Set class, since it defaults to a List datatype while reading from the database.
The only other resource I found w.r.t this error was https://stackoverflow.com/questions/45860327/how-can-i-save-set-with-mongo-scala-driver.
This is reproduce-able using the mongo-scala-driver version 2.1.0, haven't tried with older versions on my side.