Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.aggregation.operatorsComparisonValueOperatorsne

ne

open infix fun <Context : Any, Result> Value<Context, Result>.ne(other: Value<Context, Result>): Value<Context, Boolean>

Compares two aggregation values and returns true if they are not equivalent.

Example

class Product(
    val name: String,
    val creationDate: Instant,
    val releaseDate: Instant,
)

val notReleasedOnCreation = collection.aggregate()
    .match {
        expr {
            of(Product::creationDate) eq of(Product::releaseDate)
        }
    }
    .toList()

External resources

See also