
com.avsystem.commons.mongo.Update.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 com.mongodb.client.model.{Updates => U}
import org.bson.conversions.Bson
/**
* @author MKej
*/
object Update {
def combine(updates: Bson*): Bson = U.combine(updates.asJava)
def set[A](key: DocKey[A, _], value: A): Bson = U.set(key.key, key.codec.toBson(value))
def unset(key: DocKey[_, _]): Bson = U.unset(key.key)
def max[A](key: DocKey[A, _], value: A): Bson = U.max(key.key, key.codec.toBson(value))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy