Creates a Codec for a case class
Creates a Codec for a case class
the case class to create a codec from
the Codec Registry to use
the Codec for the case class
Creates a Codec for a case class
Creates a Codec for a case class
the case class to create a Codec from
the Codec for the case class
Creates a CodecProvider for a case class using the given class to represent the case class
Creates a CodecProvider for a case class using the given class to represent the case class
the case class to create a Codec from
the clazz that is the case class
the CodecProvider for the case class
Creates a CodecProvider for a case class
Creates a CodecProvider for a case class
the case class to create a Codec from
the CodecProvider for the case class
Macro based Codecs
Allows the compile time creation of Codecs for case classes.
The recommended approach is to use the implicit Macros.createCodecProvider method to help build a codecRegistry:
import org.mongodb.scala.bson.codecs.Macros.createCodecProvider import org.bson.codecs.configuration.CodecRegistries.{fromRegistries, fromProviders}
case class Contact(phone: String) case class User(_id: Int, username: String, age: Int, hobbies: List[String], contacts: List[Contact])
val codecRegistry = fromRegistries(fromProviders(classOf[User], classOf[Contact]), MongoClient.DEFAULT_CODEC_REGISTRY)
2.0