
com.avsystem.commons.mongo.DocumentCodec.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-mongo_2.13 Show documentation
Show all versions of commons-mongo_2.13 Show documentation
AVSystem commons library for Scala
package com.avsystem.commons
package mongo
import org.bson.BsonDocument
/**
* @author MKej
*/
trait DocumentCodec[T] {
def toDocument(t: T): Doc
def fromDocument(doc: Doc): T
lazy val bsonCodec: BsonCodec[T, BsonDocument] = BsonCodec.doc.map(fromDocument, toDocument)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy