package codecs
- Alphabetic
- By Inheritance
- codecs
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
BsonTypeClassMap = org.bson.codecs.BsonTypeClassMap
Type alias to the
BsonTypeClassMap -
type
BsonTypeCodecMap = org.bson.codecs.BsonTypeCodecMap
Type alias to the
BsonTypeCodecMap -
case class
IterableCodec(registry: CodecRegistry, bsonTypeClassMap: BsonTypeClassMap, valueTransformer: Transformer) extends Codec[Iterable[_]] with Product with Serializable
Encodes 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 Serializable
A
CodecProviderfor classes than implement theIterableinterface.A
CodecProviderfor classes than implement theIterableinterface.- bsonTypeClassMap
the non-null
BsonTypeClassMapwith which to construct instances ofDocumentCodecandListCodec.- valueTransformer
the value transformer for decoded values
- Since
1.2
Value Members
-
object
BsonTypeClassMap
Companion to return the default
BsonTypeClassMap -
object
IterableCodec extends Serializable
IterableCodec companion object
IterableCodec companion object
- Since
1.2
-
object
IterableCodecProvider extends Serializable
IterableCodecProvider companion object
IterableCodecProvider companion object
- Since
1.2
-
object
Macros
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[T](clazz:Class[T])* method to help build a codecRegistry:
import org.mongodb.scala.bson.cn.playscala.mongo.codecs.Macros.createCodecProvider import org.bson.cn.playscala.mongo.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