package codecs
- Alphabetic
- By Inheritance
- codecs
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
-  package macrocodecs
Type Members
-    type BsonTypeClassMap = bson.codecs.BsonTypeClassMapType alias to the BsonTypeClassMap
-    type BsonTypeCodecMap = bson.codecs.BsonTypeCodecMapType alias to the BsonTypeCodecMap
-    case class DocumentCodecProvider() extends CodecProvider with Product with SerializableA CodecProvider for the Document class and all the default Codec implementations on which it depends. 
-    case class ImmutableDocumentCodec(registry: Option[CodecRegistry]) extends CollectibleCodec[collection.immutable.Document] with Product with SerializableA 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 BsonDocumentinstance and therefore will mutate the document when adding an_id
-    case class IterableCodec(registry: CodecRegistry, bsonTypeClassMap: bson.codecs.BsonTypeClassMap, valueTransformer: Transformer) extends Codec[Iterable[_]] with Product with SerializableEncodes and decodes Iterableobjects.Encodes and decodes Iterableobjects.- Annotations
- @SuppressWarnings()
- Since
- 1.2 
 
-    case class IterableCodecProvider(bsonTypeClassMap: BsonTypeClassMap, valueTransformer: Option[Transformer]) extends CodecProvider with Product with SerializableA CodecProviderfor classes than implement theIterableinterface.A CodecProviderfor classes than implement theIterableinterface.- bsonTypeClassMap
- the non-null - BsonTypeClassMapwith which to construct instances of- DocumentCodecand- ListCodec.
- valueTransformer
- the value transformer for decoded values 
 - Since
- 1.2 
 
-    case class MutableDocumentCodec(registry: Option[CodecRegistry]) extends CollectibleCodec[collection.mutable.Document] with Product with SerializableA Codec for mutable Document instances. 
Value Members
-    object BsonTypeClassMapCompanion to return the default BsonTypeClassMap
-    object ImmutableDocumentCodec extends SerializableCompanion helper for immutable Document instances. 
-    object IterableCodec extends SerializableIterableCodec companion object IterableCodec companion object - Since
- 1.2 
 
-    object IterableCodecProvider extends SerializableIterableCodecProvider companion object IterableCodecProvider companion object - Since
- 1.2 
 
-    object MacrosMacro 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[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) - Since
- 2.0 
 
-    object MutableDocumentCodec extends SerializableCompanion helper for mutable Document instances. 
Deprecated Value Members
-    val DEFAULT_CODEC_REGISTRY: CodecRegistry- Annotations
- @deprecated
- Deprecated
- (Since version 2.9.0) Please use org.mongodb.scala.MongoClient.DEFAULT_CODEC_REGISTRY instead 
 
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: