Type alias to the BsonTypeClassMap
Type alias to the BsonTypeCodecMap
A CodecProvider for the Document class and all the default Codec implementations on which it depends.
A Codec for immutable Document instances.
A Codec for immutable Document instances.
As the underlying driver expects documents to be mutable the driver has direct access to the Documents underlying
mutable BsonDocument
instance and therefore will mutate the document when adding an _id
Encodes and decodes Iterable
objects.
Encodes and decodes Iterable
objects.
1.2
A CodecProvider
for classes than implement the Iterable
interface.
A CodecProvider
for classes than implement the Iterable
interface.
the non-null BsonTypeClassMap
with which to construct instances of DocumentCodec
and ListCodec
.
the value transformer for decoded values
1.2
A Codec for mutable Document instances.
Companion to return the default BsonTypeClassMap
Companion helper for immutable Document instances.
IterableCodec companion object
IterableCodec companion object
1.2
IterableCodecProvider companion object
IterableCodecProvider companion object
1.2
Macro based Codecs
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
Companion helper for mutable Document instances.