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 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
2.1
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
2.1
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
Creates a CodecProvider for a case class that ignores any None
values, using the given class to represent the case class
Creates a CodecProvider for a case class that ignores any None
values, 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
2.1
Creates a CodecProvider for a case class that ignores any None
values
Creates a CodecProvider for a case class that ignores any None
values
the case class to create a Codec from
the CodecProvider for the case class
2.1
(Since version ) see corresponding Javadoc for more information.
Macro based Codecs
Allows the compile time creation of Codecs for case classes.
The recommended approach is to use the implicit Macros.createCodecProvider[T](clazz:Class[T])* 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