
com.avsystem.commons.mongo.DocKey.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
The newest version!
package com.avsystem.commons
package mongo
import com.avsystem.commons.mongo.core.ops.{DocKeyFiltering, DocKeySorting}
import org.bson.{BsonDocument, BsonValue}
/**
* @author MKej
*/
case class DocKey[A, BSON <: BsonValue](key: String, codec: BsonCodec[A, BSON]) {
def ++[B, BBSON <: BsonValue](other: DocKey[B, BBSON])(implicit ev: BSON <:< BsonDocument): DocKey[B, BBSON] =
new DocKey(key + "." + other.key, other.codec)
}
object DocKey {
implicit def docKeySorting[T](docKey: DocKey[T, _ <: BsonValue]): DocKeySorting[T] = new DocKeySorting(docKey)
implicit def docKeyFiltering[T](docKey: DocKey[T, _ <: BsonValue]): DocKeyFiltering[T] = new DocKeyFiltering(docKey)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy