diff --git a/driver-sync-java/build.gradle.kts b/driver-sync-java/build.gradle.kts --- a/driver-sync-java/build.gradle.kts +++ b/driver-sync-java/build.gradle.kts @@ -33,6 +33,7 @@ dependencies { api(projects.driverSync) api(libs.java.accessLambdaName) + implementation(kotlin("reflect")) testImplementation(libs.junit.jupiter.api) testImplementation(libs.junit.jupiter.engine) testImplementation(libs.junit.platform.launcher) diff --git a/gradle/conventions/dsl-templator/README.md b/gradle/conventions/dsl-templator/README.md --- a/gradle/conventions/dsl-templator/README.md +++ b/gradle/conventions/dsl-templator/README.md @@ -24,6 +24,7 @@ - members (methods and properties) - that are public - that are NOT marked `override` +- that do NOT have a `KType` parameter (those are internal delegation targets called by `inline reified` overloads) If the overload already exists, it is not generated. diff --git a/driver-sync-java/src/main/kotlin/KtMongo.kt b/driver-sync-java/src/main/kotlin/KtMongo.kt --- a/driver-sync-java/src/main/kotlin/KtMongo.kt +++ b/driver-sync-java/src/main/kotlin/KtMongo.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, OpenSavvy and contributors. + * Copyright (c) 2025-2026, OpenSavvy and contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,13 @@ package opensavvy.ktmongo.sync import com.mongodb.client.MongoCollection +import kotlin.reflect.KClass +import kotlin.reflect.KClassifier +import kotlin.reflect.KType +import kotlin.reflect.KTypeProjection +import kotlin.reflect.full.allSuperclasses +import kotlin.reflect.full.isSubclassOf +import kotlin.reflect.full.isSuperclassOf /** * Entry-point to convert objects from the official drivers to the KtMongo library. @@ -69,4 +76,79 @@ @JvmStatic fun from(driver: com.mongodb.kotlin.client.MongoCollection): JvmMongoCollection = driver.asKtMongo() + + private val typeOfNull: KType = kotlin.reflect.typeOf() + + private fun typeOfKotlinClass(value: T?, type: KClass): KType = + object : KType { + override val classifier: KClassifier + get() = type + + private fun Iterable.superClass(): KClass<*> = this + .asSequence() + .filterNotNull() + .map { it::class as KClass<*> } + .reduceOrNull { a, b -> + when { + a == b -> a + a.isSuperclassOf(b) -> a + b.isSuperclassOf(a) -> b + else -> { + // The common parent is the KClass that appears in both lists but isn't a supertype of any + // other listed KClass. + val commonParent = (a.allSuperclasses.toSet() intersect b.allSuperclasses.toSet()) + .reduceOrNull { candidateA, candidateB -> + when { + candidateA.isSubclassOf(candidateB) -> candidateA + candidateB.isSubclassOf(candidateA) -> candidateB + else -> Any::class + } + } + + commonParent ?: Any::class + } + } + } + ?: Any::class + + @Suppress("UNCHECKED_CAST") + override val arguments: List by lazy(mode = LazyThreadSafetyMode.PUBLICATION) { + when (value) { + is Collection<*> if value.isNotEmpty() -> listOf( + KTypeProjection.invariant(typeOf(value.first(), value.superClass() as KClass)) + ) + + is Map<*, *> if value.isNotEmpty() -> listOf( + KTypeProjection.invariant(typeOf(value.keys.first(), value.keys.superClass() as KClass)), + KTypeProjection.invariant(typeOf(value.values.first(), value.values.superClass() as KClass)) + ) + + else -> emptyList() + } + } + + override val isMarkedNullable: Boolean + get() = true // Java types are always declared nullable + + override val annotations: List + get() = emptyList() + + override fun toString(): String = "TypeOf($type)" + } + + private fun typeOf(value: T, type: KClass): KType = + if (value == null) typeOfNull + else typeOfKotlinClass(value, type) + + /** + * Obtains a Kotlin [KType] instance for a Java [value]. + * + * This method is a workaround required for now. In the future, when we move to stabilize the Java KtMongo driver, + * this will not be necessary anymore. + */ + @Suppress("UNCHECKED_CAST") + @JvmStatic + fun typeOf(value: T): KType = + if (value == null) typeOfNull + else return typeOfKotlinClass(value, value::class as KClass) } diff --git a/dsl-template/src/commonMain/kotlin/query/FilterQuery.kt b/dsl-template/src/commonMain/kotlin/query/FilterQuery.kt --- a/dsl-template/src/commonMain/kotlin/query/FilterQuery.kt +++ b/dsl-template/src/commonMain/kotlin/query/FilterQuery.kt @@ -26,6 +26,8 @@ import opensavvy.ktmongo.dsl.path.* import opensavvy.ktmongo.dsl.tree.CompoundBsonNode import org.intellij.lang.annotations.Language +import kotlin.reflect.KType +import kotlin.reflect.typeOf /** * DSL for MongoDB operators that are used as predicates in conditions. @@ -263,7 +265,40 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - operator fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit) + fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit, type: KType) + + /** + * Targets a single field to execute a [targeted predicate][FilterQueryPredicate]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.find { + * User::name { + * eq("foo") + * } + * } + * ``` + * + * Note that many operators available this way have a convenience function directly in this class to + * shorten this. For this example, see [eq]: + * + * ```kotlin + * collection.find { + * User::name eq "foo" + * } + * ``` + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V> Field.invoke(noinline block: FilterQueryPredicate.() -> Unit) { + this.invoke(block, typeOf()) + } // endregion // region $not @@ -294,8 +329,38 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.not(expression: FilterQueryPredicate.() -> Unit) { - this { not(expression) } + fun <@kotlin.internal.OnlyInputTypes V> Field.not(expression: FilterQueryPredicate.() -> Unit, type: KType) { + this.invoke({ not(expression) }, type) + } + + /** + * Performs a logical `NOT` operation on the specified [expression] and selects the + * documents that *do not* match the expression. This includes the elements + * that do not contain the field. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * ) + * + * collection.find { + * User::age not { + * hasType(BsonType.STRING) + * } + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/not/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.not(noinline expression: FilterQueryPredicate.() -> Unit) { + this.not(expression, typeOf()) } // endregion @@ -323,8 +388,34 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.eq(value: V) { - this { eq(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.eq(value: V, type: KType) { + this.invoke({ eq(value) }, type) + } + + /** + * Matches documents where the value of a field equals the [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.find { + * User::name eq "foo" + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.eq(value: V) { + this.eq(value, typeOf()) } /** @@ -357,8 +448,42 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.eqNotNull(value: V?) { - this { eqNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.eqNotNull(value: V?, type: KType) { + this.invoke({ eqNotNull(value) }, type) + } + + /** + * Matches documents where the value of a field equals [value]. + * + * If [value] is `null`, the operator is not added (all documents are matched). + * + * ### Example + * + * This operator is useful to simplify searches when the criteria are optional. + * For example, instead of writing: + * ```kotlin + * collection.find { + * if (criteria.name != null) + * User::name eq criteria.name + * } + * ``` + * this operator can be used instead: + * ```kotlin + * collection.find { + * User::name eqNotNull criteria.name + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + * + * @see eq Equality filter. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.eqNotNull(value: V?) { + this.eqNotNull(value, typeOf()) } // endregion @@ -390,8 +515,38 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.ne(value: V) { - this { ne(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.ne(value: V, type: KType) { + this.invoke({ ne(value) }, type) + } + + /** + * Matches documents where the value of a field does not equal the [value]. + * + * The result includes documents which do not contain the specified field. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.find { + * User::name ne "foo" + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/ne/) + * + * @see eq + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.ne(value: V) { + this.ne(value, typeOf()) } // endregion @@ -746,8 +901,36 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gt(value: V) { - this { gt(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gt(value: V, type: KType) { + this.invoke({ gt(value) }, type) + } + + /** + * Selects documents for which this field has a value strictly greater than [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age gt 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + * + * @see gtNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gt(value: V) { + this.gt(value, typeOf()) } /** @@ -777,8 +960,39 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gtNotNull(value: V?) { - this { gtNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gtNotNull(value: V?, type: KType) { + this.invoke({ gtNotNull(value) }, type) + } + + /** + * Selects documents for which this field has a value strictly greater than [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age gtNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + * + * @see gt + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gtNotNull(value: V?) { + this.gtNotNull(value, typeOf()) } /** @@ -805,8 +1019,36 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gte(value: V) { - this { gte(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gte(value: V, type: KType) { + this.invoke({ gte(value) }, type) + } + + /** + * Selects documents for which this field has a value greater or equal to [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age gte 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + * + * @see gteNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gte(value: V) { + this.gte(value, typeOf()) } /** @@ -836,8 +1078,39 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gteNotNull(value: V?) { - this { gteNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gteNotNull(value: V?, type: KType) { + this.invoke({ gteNotNull(value) }, type) + } + + /** + * Selects documents for which this field has a value greater or equal to [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age gteNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + * + * @see gte + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gteNotNull(value: V?) { + this.gteNotNull(value, typeOf()) } /** @@ -864,8 +1137,36 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.lt(value: V) { - this { lt(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.lt(value: V, type: KType) { + this.invoke({ lt(value) }, type) + } + + /** + * Selects documents for which this field has a value strictly lesser than [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age lt 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + * + * @see ltNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.lt(value: V) { + this.lt(value, typeOf()) } /** @@ -895,8 +1196,39 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.ltNotNull(value: V?) { - this { ltNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.ltNotNull(value: V?, type: KType) { + this.invoke({ ltNotNull(value) }, type) + } + + /** + * Selects documents for which this field has a value strictly lesser than [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age ltNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + * + * @see lt + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.ltNotNull(value: V?) { + this.ltNotNull(value, typeOf()) } /** @@ -923,8 +1255,36 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.lte(value: V) { - this { lte(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.lte(value: V, type: KType) { + this.invoke({ lte(value) }, type) + } + + /** + * Selects documents for which this field has a value lesser or equal to [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age lte 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + * + * @see lteNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.lte(value: V) { + this.lte(value, typeOf()) } /** @@ -954,8 +1314,39 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.lteNotNull(value: V?) { - this { lteNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.lteNotNull(value: V?, type: KType) { + this.invoke({ lteNotNull(value) }, type) + } + + /** + * Selects documents for which this field has a value lesser or equal to [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age lteNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + * + * @see lte + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.lteNotNull(value: V?) { + this.lteNotNull(value, typeOf()) } // region Ranges (isIn) @@ -981,12 +1372,37 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: ClosedRange) { + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: ClosedRange, type: KType) { val field = this and { - field gte range.start - field lte range.endInclusive + field.gte(range.start, type) + field.lte(range.endInclusive, type) } + } + + /** + * Selects documents in which this field has a value included in [range]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age isIn (25..50) + * } + * ``` + * + * @see gte Only specify the lower bound. + * @see lte Only specify the higher bound. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.isIn(range: ClosedRange) { + this.isIn(range, typeOf()) } /** @@ -1010,12 +1426,37 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: OpenEndRange) { + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: OpenEndRange, type: KType) { val field = this and { - field gte range.start - field lt range.endExclusive + field.gte(range.start, type) + field.lt(range.endExclusive, type) } + } + + /** + * Selects documents in which this field has a value included in [range]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age isIn (25..<50) + * } + * ``` + * + * @see gte Only specify the lower bound. + * @see lt Only specify the higher bound. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.isIn(range: OpenEndRange) { + this.isIn(range, typeOf()) } // Some ranges are both ClosedRange and OpenEndRange @@ -1042,15 +1483,92 @@ * @see lte Only specify the higher bound. */ @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @JvmName("isInSimpleWithType") + @KtMongoDsl + fun <@kotlin.internal.OnlyInputTypes V : Comparable, R> Field.isIn(range: R, type: KType) where R : ClosedRange, R : OpenEndRange { + this.isIn(range as ClosedRange, type) + } + + /** + * Selects documents in which this field has a value included in [range]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age isIn (25..50) + * } + * ``` + * + * @see gte Only specify the lower bound. + * @see lte Only specify the higher bound. + */ + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @JvmName("isInSimple") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable, R> Field.isIn(range: R) where R : ClosedRange, R : OpenEndRange { - this isIn (range as ClosedRange) + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable, R> Field.isIn(range: R) where R : ClosedRange, R : OpenEndRange { + this.isIn(range, typeOf()) } // endregion // endregion // region $in + + /** + * Selects documents for which this field is equal to one of the given [values]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::name isOneOf listOf("Alfred", "Arthur") + * } + * ``` + */ + @Suppress("INVISIBLE_REFERENCE") + @KtMongoDsl + fun <@kotlin.internal.OnlyInputTypes V> Field.isOneOf(values: List, type: KType) { + this.invoke({ isOneOf(values) }, type) + } + + /** + * Selects documents for which this field is equal to one of the given [values]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::name isOneOf listOf("Alfred", "Arthur") + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) + * + * @see or + * @see eq + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.isOneOf(values: List) { + this.isOneOf(values, typeOf()) + } /** * Selects documents for which this field is equal to one of the given [values]. @@ -1075,39 +1593,10 @@ * @see or * @see eq */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isOneOf(values: List) { - this { isOneOf(values) } - } - - /** - * Selects documents for which this field is equal to one of the given [values]. - * - * ### Example - * - * ```kotlin - * class User( - * val name: String, - * val age: Int?, - * ) - * - * collection.find { - * User::name.isOneOf("Alfred", "Arthur") - * } - * ``` - * - * ### External resources - * - * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) - * - * @see or - * @see eq - */ - @Suppress("INVISIBLE_REFERENCE") - @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isOneOf(vararg values: V) { - isOneOf(values.asList()) + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.isOneOf(vararg values: V) { + this.isOneOf(values.asList()) } /** @@ -1124,7 +1613,7 @@ * ) * * collection.find { - * User::name.isNotOneOf(listOf("Alfred", "Arthur")) + * User::name isNotOneOf listOf("Alfred", "Arthur") * } * ``` * @@ -1137,8 +1626,39 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isNotOneOf(values: List) { - this { isNotOneOf(values) } + fun <@kotlin.internal.OnlyInputTypes V> Field.isNotOneOf(values: List, type: KType) { + this.invoke({ isNotOneOf(values) }, type) + } + + /** + * Selects documents for which this field is not equal to any of the given [values]. + * + * This operator will also select documents for which the field doesn't exist. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::name isNotOneOf listOf("Alfred", "Arthur") + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/nin/) + * + * @see isOneOf + * @see ne + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.isNotOneOf(values: List) { + this.isNotOneOf(values, typeOf()) } /** @@ -1166,9 +1686,9 @@ * @see isOneOf * @see ne */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isNotOneOf(vararg values: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.isNotOneOf(vararg values: V) { isNotOneOf(values.asList()) } @@ -1338,7 +1858,62 @@ */ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl - fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit) + fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit, type: KType) + + /** + * Specify multiple operators on a single array element. + * + * ### Example + * + * Find students with a grade between 8 and 10, that may be eligible to perform + * an exam a second time. + * + * ```kotlin + * class Student( + * val name: String, + * val grades: List + * ) + * + * collection.find { + * Student::grades.anyValue { + * gte(8) + * lte(10) + * } + * } + * ``` + * + * The following document will match because the grade 9 is in the interval. + * ```json + * { + * "name": "John", + * "grades": [9, 3] + * } + * ``` + * + * The following document will NOT match, because none of the grades are in the interval. + * ```json + * { + * "name": "Lea", + * "grades": [18, 19] + * } + * ``` + * + * If you want to perform multiple checks on different elements of an array, + * see the [any] property. + * + * This function only allows specifying operators on array elements directly. + * To specify operators on sub-fields of array elements, see [any]. + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/) + */ + @OptIn(LowLevelApi::class, DangerousMongoApi::class) + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline fun Field>.anyValue(noinline block: FilterQueryPredicate.() -> Unit) { + this.anyValue(block, typeOf()) + } /** * Specify multiple operators on fields of a single array element. @@ -1420,7 +1995,32 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/all/) */ @KtMongoDsl - infix fun Field>.containsAll(values: Collection) + fun Field>.containsAll(values: Collection, type: KType) + + /** + * Selects documents where the value of a field is an array that contains all the specified [values]. + * + * ### Example + * + * ```kotlin + * class User( + * val grades: List + * ) + * + * collection.find { + * User::grades containsAll listOf(2, 3, 7) + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/all/) + */ + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun Field>.containsAll(values: Collection) { + this.containsAll(values, typeOf()) + } // endregion // region $size diff --git a/dsl-template/src/commonMain/kotlin/query/FilterQueryImpl.kt b/dsl-template/src/commonMain/kotlin/query/FilterQueryImpl.kt --- a/dsl-template/src/commonMain/kotlin/query/FilterQueryImpl.kt +++ b/dsl-template/src/commonMain/kotlin/query/FilterQueryImpl.kt @@ -32,6 +32,7 @@ import opensavvy.ktmongo.dsl.tree.AbstractBsonNode import opensavvy.ktmongo.dsl.tree.AbstractCompoundBsonNode import opensavvy.ktmongo.dsl.tree.BsonNode +import kotlin.reflect.KType @KtMongoDsl private class FilterQueryImpl( @@ -175,8 +176,8 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override operator fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit) { - accept(PredicateInFilterBsonNode(path, FilterQueryPredicate(context).apply(block), context)) + override operator fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit, type: KType) { + accept(PredicateInFilterBsonNode(path, FilterQueryPredicate(context, type).apply(block), context)) } @LowLevelApi @@ -202,8 +203,8 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl - override fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit) { - accept(ElementMatchBsonNodeNode(this.path, FilterQueryPredicate(context).apply(block), context)) + override fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit, type: KType) { + accept(ElementMatchBsonNodeNode(this.path, FilterQueryPredicate(context, type).apply(block), context)) } @OptIn(LowLevelApi::class, DangerousMongoApi::class) @@ -238,7 +239,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl - override infix fun Field>.containsAll(values: Collection) { + override fun Field>.containsAll(values: Collection, type: KType) { accept(ArrayAllBsonNodeNode(path, values, context)) } diff --git a/dsl-template/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt b/dsl-template/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt --- a/dsl-template/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt +++ b/dsl-template/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt @@ -28,6 +28,8 @@ import opensavvy.ktmongo.dsl.tree.AbstractBsonNode import opensavvy.ktmongo.dsl.tree.AbstractCompoundBsonNode import opensavvy.ktmongo.dsl.tree.BsonNode +import kotlin.reflect.KType +import kotlin.reflect.typeOf /** * Implementation of [FilterQueryPredicate]. @@ -35,6 +37,7 @@ @KtMongoDsl private class FilterQueryPredicateImpl( context: BsonContext, + val type: KType, ) : AbstractCompoundBsonNode(context), FilterQueryPredicate { // region Low-level operations @@ -139,7 +142,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl override fun not(expression: FilterQueryPredicate.() -> Unit) { - accept(NotPredicateBsonNodeNode(FilterQueryPredicateImpl(context).apply(expression), context)) + accept(NotPredicateBsonNodeNode(FilterQueryPredicateImpl(context, type).apply(expression), context)) } @LowLevelApi @@ -411,7 +414,25 @@ /** * Creates an empty [FilterQueryPredicate]. + * + * Users should generally not need to interact with this function, as KtMongo already provides an instance of + * [FilterQueryPredicate] in all contexts where one is useful. + * + * If calling this method, prefer the inline overload. + * + * @param type The [KType] instance that corresponds to type [T]. + * If [KType] doesn't correspond to [T], the behavior is unspecified. */ @LowLevelApi -fun FilterQueryPredicate(context: BsonContext): FilterQueryPredicate = - FilterQueryPredicateImpl(context) +fun FilterQueryPredicate(context: BsonContext, type: KType): FilterQueryPredicate = + FilterQueryPredicateImpl(context, type) + +/** + * Creates an empty [FilterQueryPredicate]. + * + * Users should generally not need to interact with this function, as KtMongo already provides an instance of + * [FilterQueryPredicate] in all contexts where one is useful. + */ +@LowLevelApi +inline fun FilterQueryPredicate(context: BsonContext): FilterQueryPredicate = + FilterQueryPredicate(context, typeOf()) diff --git a/dsl-template/src/commonMain/kotlin/query/UpdateQuery.kt b/dsl-template/src/commonMain/kotlin/query/UpdateQuery.kt --- a/dsl-template/src/commonMain/kotlin/query/UpdateQuery.kt +++ b/dsl-template/src/commonMain/kotlin/query/UpdateQuery.kt @@ -22,6 +22,8 @@ import opensavvy.ktmongo.dsl.LowLevelApi import opensavvy.ktmongo.dsl.path.* import opensavvy.ktmongo.dsl.tree.CompoundBsonNode +import kotlin.reflect.KType +import kotlin.reflect.typeOf import kotlin.time.Instant /** @@ -104,7 +106,37 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V) + fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V, type: KType) + + /** + * Replaces the value of a field with the specified [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.filter { + * User::name eq "foo" + * }.updateMany { + * User::age set 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/set/) + * + * @see UpsertQuery.setOnInsert Only set if a new document is created. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.set(value: V) { + set(value, typeOf()) + } /** * Replaces the value of a field with the specified [value], if [condition] is `true`. @@ -132,9 +164,9 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setIf(condition: Boolean, value: V) { if (condition) this set value } @@ -165,9 +197,9 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setUnless(condition: Boolean, value: V) { if (!condition) this set value } @@ -205,7 +237,41 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V) + fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V, type: KType) + + /** + * Increments a field by the specified [amount]. + * + * [amount] may be negative, in which case the field is decremented. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of [amount]. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * ) + * + * // It's the new year! + * collection.updateMany { + * User::age inc 1 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.inc(amount: V) { + this.inc(amount, typeOf()) + } /** * Increments a field by the specified [amount]. @@ -235,9 +301,9 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun <@kotlin.internal.OnlyInputTypes V : Number> Field.plusAssign(amount: V): Unit = + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.plusAssign(amount: V): Unit = this.inc(amount) // endregion @@ -270,7 +336,69 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V) + fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V, type: KType) + + /** + * Multiplies a field by the specified [amount]. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of 0. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val price: Double, + * ) + * + * collection.updateMany { + * User::price mul 2.0 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/mul/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.mul(amount: V) { + this.mul(amount, typeOf()) + } + + /** + * Multiplies a field by the specified [amount]. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of 0. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val price: Double, + * ) + * + * collection.updateMany { + * User::price *= 2.0 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/mul/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.timesAssign(amount: V) { + this mul amount + } // endregion // region $unset @@ -330,7 +458,35 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V) + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V, type: KType) + + /** + * Updates the value of a field to the specified [value] only if the specified [value] is less than the current value of the field. + * + * If the field doesn't exist, the field is set to the specified [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val score: Int, + * ) + * + * collection.updateMany { + * User::score min 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/min/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.min(value: V) { + this.min(value, typeOf()) + } /** * Updates the value of a field to the specified [value] only if the specified [value] is greater than the current value of the field. @@ -356,7 +512,35 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V) + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V, type: KType) + + /** + * Updates the value of a field to the specified [value] only if the specified [value] is greater than the current value of the field. + * + * If the field doesn't exist, the field is set to the specified [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val score: Int, + * ) + * + * collection.updateMany { + * User::score max 100 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/max/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.max(value: V) { + this.max(value, typeOf()) + } // endregion // region $rename @@ -496,6 +680,7 @@ @OptIn(LowLevelApi::class) val Field>.selected: Field get() = FieldImpl(path / PathSegment.Positional) + // endregion // region All positional operator: $[] @@ -565,7 +750,43 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field>.addToSet(value: V) + fun <@kotlin.internal.OnlyInputTypes V> Field>.addToSet(value: V, type: KType) + + /** + * Adds [value] at the end of the array, unless it is already present, in which case it does nothing. + * + * MongoDB detects equality if the two documents are exactly identical. All the fields must be the same _in the same order_. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * val tokens: List, + * ) + * + * collection.updateOne( + * filter = { + * User::name eq "Bob" + * }, + * update = { + * User::tokens addToSet "123456789" + * } + * ) + * ``` + * + * This will add `"123456789"` to the user's tokens only if it isn't already present. + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/v7.0/reference/operator/update/addToSet/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field>.addToSet(value: V) { + this.addToSet(value, typeOf()) + } /** * Adds multiple [values] at the end of the array, unless they are already present. @@ -592,7 +813,7 @@ * User::name eq "Bob" * }, * update = { - * User::tokens addToSet listOf("123456789", "789456123") + * User::tokens addEachToSet listOf("123456789", "789456123") * } * ) * ``` @@ -606,9 +827,52 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field>.addToSet(values: Iterable) { + fun <@kotlin.internal.OnlyInputTypes V> Field>.addEachToSet(values: Iterable, type: KType) { for (value in values) - this addToSet value + this.addToSet(value, type) + } + + /** + * Adds multiple [values] at the end of the array, unless they are already present. + * + * Each value in [values] is treated independently. + * It if it is already present in the array, nothing happens. + * If it is absent from the array, it is added at the end. + * + * MongoDB detects equality if the two documents are exactly identical. All the fields must be the same _in the same order_. + * + * This is a convenience function for calling [addToSet] multiple times. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * val tokens: List, + * ) + * + * collection.updateOne( + * filter = { + * User::name eq "Bob" + * }, + * update = { + * User::tokens addEachToSet listOf("123456789", "789456123") + * } + * ) + * ``` + * + * This will add `"123456789"` and `"789465123"` to the user's tokens only if they aren't already present. + * If only one of them is present, the other is added. + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/v7.0/reference/operator/update/addToSet/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field>.addEachToSet(values: Iterable) { + this.addEachToSet(values, typeOf()) } // endregion @@ -655,7 +919,39 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V) + fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V, type: KType) + + /** + * If an upsert operation results in an insert of a document, + * then this operator assigns the specified [value] to the field. + * If the update operation does not result in an insert, this operator does nothing. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.filter { + * User::name eq "foo" + * }.upsertOne { + * User::age setOnInsert 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/setOnInsert/) + * + * @see set Always set the value. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.setOnInsert(value: V) { + this.setOnInsert(value, typeOf()) + } // endregion diff --git a/dsl-template/src/commonMain/kotlin/query/UpdateQueryImpl.kt b/dsl-template/src/commonMain/kotlin/query/UpdateQueryImpl.kt --- a/dsl-template/src/commonMain/kotlin/query/UpdateQueryImpl.kt +++ b/dsl-template/src/commonMain/kotlin/query/UpdateQueryImpl.kt @@ -33,6 +33,7 @@ import opensavvy.ktmongo.dsl.tree.BsonNode import opensavvy.ktmongo.dsl.tree.acceptAll import kotlin.reflect.KClass +import kotlin.reflect.KType import kotlin.time.Instant /** @@ -92,7 +93,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V, type: KType) { accept(SetBsonNodeNode(listOf(this.path to value), context)) } @@ -120,7 +121,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V, type: KType) { accept(SetOnInsertBsonNodeNode(listOf(this.path to value), context)) } @@ -147,7 +148,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V, type: KType) { accept(IncrementBsonNodeNode(listOf(this.path to amount), context)) } @@ -174,7 +175,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V, type: KType) { accept(MultiplyBsonNodeNode(listOf(this.path to amount), context)) } @@ -228,7 +229,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V, type: KType) { accept(MinBsonNodeNode(listOf(this.path to value), context)) } @@ -255,7 +256,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V, type: KType) { accept(MaxBsonNodeNode(listOf(this.path to value), context)) } @@ -348,7 +349,7 @@ // region $setOnInsert @OptIn(DangerousMongoApi::class, LowLevelApi::class) - override fun Field>.addToSet(value: V) { + override fun Field>.addToSet(value: V, type: KType) { accept(AddToSetBsonNode(listOf(this.path to value), context)) } diff --git a/dsl/src/commonMain/kotlin/query/FilterQuery.kt b/dsl/src/commonMain/kotlin/query/FilterQuery.kt --- a/dsl/src/commonMain/kotlin/query/FilterQuery.kt +++ b/dsl/src/commonMain/kotlin/query/FilterQuery.kt @@ -29,6 +29,8 @@ import opensavvy.ktmongo.dsl.path.* import opensavvy.ktmongo.dsl.tree.CompoundBsonNode import org.intellij.lang.annotations.Language +import kotlin.reflect.KType +import kotlin.reflect.typeOf /** * DSL for MongoDB operators that are used as predicates in conditions. @@ -266,7 +268,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - operator fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit) + fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit, type: KType) /** * Targets a single field to execute a [targeted predicate][FilterQueryPredicate]. @@ -295,9 +297,42 @@ * } * ``` */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.invoke(block: FilterQueryPredicate.() -> Unit) { + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V> Field.invoke(noinline block: FilterQueryPredicate.() -> Unit) { + this.invoke(block, typeOf()) + } + + /** + * Targets a single field to execute a [targeted predicate][FilterQueryPredicate]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.find { + * User::name { + * eq("foo") + * } + * } + * ``` + * + * Note that many operators available this way have a convenience function directly in this class to + * shorten this. For this example, see [eq]: + * + * ```kotlin + * collection.find { + * User::name eq "foo" + * } + * ``` + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.invoke(noinline block: FilterQueryPredicate.() -> Unit) { return this.field.invoke(block) } @@ -330,8 +365,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.not(expression: FilterQueryPredicate.() -> Unit) { - this { not(expression) } + fun <@kotlin.internal.OnlyInputTypes V> Field.not(expression: FilterQueryPredicate.() -> Unit, type: KType) { + this.invoke({ not(expression) }, type) } /** @@ -358,9 +393,39 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/not/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.not(expression: FilterQueryPredicate.() -> Unit) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.not(noinline expression: FilterQueryPredicate.() -> Unit) { + this.not(expression, typeOf()) + } + + /** + * Performs a logical `NOT` operation on the specified [expression] and selects the + * documents that *do not* match the expression. This includes the elements + * that do not contain the field. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * ) + * + * collection.find { + * User::age not { + * hasType(BsonType.STRING) + * } + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/not/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.not(noinline expression: FilterQueryPredicate.() -> Unit) { return this.field.not(expression) } @@ -389,8 +454,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.eq(value: V) { - this { eq(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.eq(value: V, type: KType) { + this.invoke({ eq(value) }, type) } /** @@ -413,9 +478,35 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.eq(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.eq(value: V) { + this.eq(value, typeOf()) + } + + /** + * Matches documents where the value of a field equals the [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.find { + * User::name eq "foo" + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.eq(value: V) { return this.field.eq(value) } @@ -449,8 +540,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.eqNotNull(value: V?) { - this { eqNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.eqNotNull(value: V?, type: KType) { + this.invoke({ eqNotNull(value) }, type) } /** @@ -481,9 +572,43 @@ * * @see eq Equality filter. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.eqNotNull(value: V?) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.eqNotNull(value: V?) { + this.eqNotNull(value, typeOf()) + } + + /** + * Matches documents where the value of a field equals [value]. + * + * If [value] is `null`, the operator is not added (all documents are matched). + * + * ### Example + * + * This operator is useful to simplify searches when the criteria are optional. + * For example, instead of writing: + * ```kotlin + * collection.find { + * if (criteria.name != null) + * User::name eq criteria.name + * } + * ``` + * this operator can be used instead: + * ```kotlin + * collection.find { + * User::name eqNotNull criteria.name + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) + * + * @see eq Equality filter. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.eqNotNull(value: V?) { return this.field.eqNotNull(value) } @@ -516,8 +641,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.ne(value: V) { - this { ne(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.ne(value: V, type: KType) { + this.invoke({ ne(value) }, type) } /** @@ -544,9 +669,39 @@ * * @see eq */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.ne(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.ne(value: V) { + this.ne(value, typeOf()) + } + + /** + * Matches documents where the value of a field does not equal the [value]. + * + * The result includes documents which do not contain the specified field. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.find { + * User::name ne "foo" + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/ne/) + * + * @see eq + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.ne(value: V) { return this.field.ne(value) } @@ -1216,8 +1371,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gt(value: V) { - this { gt(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gt(value: V, type: KType) { + this.invoke({ gt(value) }, type) } /** @@ -1242,9 +1397,37 @@ * * @see gtNotNull */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.gt(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gt(value: V) { + this.gt(value, typeOf()) + } + + /** + * Selects documents for which this field has a value strictly greater than [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age gt 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + * + * @see gtNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.gt(value: V) { return this.field.gt(value) } @@ -1275,8 +1458,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gtNotNull(value: V?) { - this { gtNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gtNotNull(value: V?, type: KType) { + this.invoke({ gtNotNull(value) }, type) } /** @@ -1304,9 +1487,40 @@ * @see gt * @see eqNotNull Learn more about the 'notNull' variants */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.gtNotNull(value: V?) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gtNotNull(value: V?) { + this.gtNotNull(value, typeOf()) + } + + /** + * Selects documents for which this field has a value strictly greater than [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age gtNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) + * + * @see gt + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.gtNotNull(value: V?) { return this.field.gtNotNull(value) } @@ -1334,8 +1548,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gte(value: V) { - this { gte(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gte(value: V, type: KType) { + this.invoke({ gte(value) }, type) } /** @@ -1360,9 +1574,37 @@ * * @see gteNotNull */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.gte(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gte(value: V) { + this.gte(value, typeOf()) + } + + /** + * Selects documents for which this field has a value greater or equal to [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age gte 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + * + * @see gteNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.gte(value: V) { return this.field.gte(value) } @@ -1393,8 +1635,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.gteNotNull(value: V?) { - this { gteNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.gteNotNull(value: V?, type: KType) { + this.invoke({ gteNotNull(value) }, type) } /** @@ -1422,9 +1664,40 @@ * @see gte * @see eqNotNull Learn more about the 'notNull' variants */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.gteNotNull(value: V?) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.gteNotNull(value: V?) { + this.gteNotNull(value, typeOf()) + } + + /** + * Selects documents for which this field has a value greater or equal to [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age gteNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) + * + * @see gte + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.gteNotNull(value: V?) { return this.field.gteNotNull(value) } @@ -1452,8 +1725,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.lt(value: V) { - this { lt(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.lt(value: V, type: KType) { + this.invoke({ lt(value) }, type) } /** @@ -1478,9 +1751,37 @@ * * @see ltNotNull */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.lt(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.lt(value: V) { + this.lt(value, typeOf()) + } + + /** + * Selects documents for which this field has a value strictly lesser than [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age lt 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + * + * @see ltNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.lt(value: V) { return this.field.lt(value) } @@ -1511,8 +1812,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.ltNotNull(value: V?) { - this { ltNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.ltNotNull(value: V?, type: KType) { + this.invoke({ ltNotNull(value) }, type) } /** @@ -1540,9 +1841,40 @@ * @see lt * @see eqNotNull Learn more about the 'notNull' variants */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.ltNotNull(value: V?) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.ltNotNull(value: V?) { + this.ltNotNull(value, typeOf()) + } + + /** + * Selects documents for which this field has a value strictly lesser than [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age ltNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) + * + * @see lt + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.ltNotNull(value: V?) { return this.field.ltNotNull(value) } @@ -1570,8 +1902,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.lte(value: V) { - this { lte(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.lte(value: V, type: KType) { + this.invoke({ lte(value) }, type) } /** @@ -1596,9 +1928,37 @@ * * @see lteNotNull */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.lte(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.lte(value: V) { + this.lte(value, typeOf()) + } + + /** + * Selects documents for which this field has a value lesser or equal to [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::age lte 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + * + * @see lteNotNull + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.lte(value: V) { return this.field.lte(value) } @@ -1629,8 +1989,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.lteNotNull(value: V?) { - this { lteNotNull(value) } + fun <@kotlin.internal.OnlyInputTypes V> Field.lteNotNull(value: V?, type: KType) { + this.invoke({ lteNotNull(value) }, type) } /** @@ -1658,9 +2018,40 @@ * @see lte * @see eqNotNull Learn more about the 'notNull' variants */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.lteNotNull(value: V?) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.lteNotNull(value: V?) { + this.lteNotNull(value, typeOf()) + } + + /** + * Selects documents for which this field has a value lesser or equal to [value]. + * + * If [value] is `null`, the operator is not added (all elements are matched). + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age lteNotNull 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) + * + * @see lte + * @see eqNotNull Learn more about the 'notNull' variants + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.lteNotNull(value: V?) { return this.field.lteNotNull(value) } @@ -1687,11 +2078,11 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: ClosedRange) { + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: ClosedRange, type: KType) { val field = this and { - field gte range.start - field lte range.endInclusive + field.gte(range.start, type) + field.lte(range.endInclusive, type) } } @@ -1714,9 +2105,34 @@ * @see gte Only specify the lower bound. * @see lte Only specify the higher bound. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> kotlin.reflect.KProperty1.isIn(range: ClosedRange) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.isIn(range: ClosedRange) { + this.isIn(range, typeOf()) + } + + /** + * Selects documents in which this field has a value included in [range]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age isIn (25..50) + * } + * ``` + * + * @see gte Only specify the lower bound. + * @see lte Only specify the higher bound. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> kotlin.reflect.KProperty1.isIn(range: ClosedRange) { return this.field.isIn(range) } @@ -1741,11 +2157,11 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: OpenEndRange) { + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.isIn(range: OpenEndRange, type: KType) { val field = this and { - field gte range.start - field lt range.endExclusive + field.gte(range.start, type) + field.lt(range.endExclusive, type) } } @@ -1768,9 +2184,34 @@ * @see gte Only specify the lower bound. * @see lt Only specify the higher bound. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> kotlin.reflect.KProperty1.isIn(range: OpenEndRange) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.isIn(range: OpenEndRange) { + this.isIn(range, typeOf()) + } + + /** + * Selects documents in which this field has a value included in [range]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age isIn (25..<50) + * } + * ``` + * + * @see gte Only specify the lower bound. + * @see lt Only specify the higher bound. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> kotlin.reflect.KProperty1.isIn(range: OpenEndRange) { return this.field.isIn(range) } @@ -1798,10 +2239,10 @@ * @see lte Only specify the higher bound. */ @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") - @JvmName("isInSimple") + @JvmName("isInSimpleWithType") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable, R> Field.isIn(range: R) where R : ClosedRange, R : OpenEndRange { - this isIn (range as ClosedRange) + fun <@kotlin.internal.OnlyInputTypes V : Comparable, R> Field.isIn(range: R, type: KType) where R : ClosedRange, R : OpenEndRange { + this.isIn(range as ClosedRange, type) } /** @@ -1823,10 +2264,36 @@ * @see gte Only specify the lower bound. * @see lte Only specify the higher bound. */ - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @JvmName("isInSimple") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable, R> kotlin.reflect.KProperty1.isIn(range: R) where R : ClosedRange, R : OpenEndRange { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable, R> Field.isIn(range: R) where R : ClosedRange, R : OpenEndRange { + this.isIn(range, typeOf()) + } + + /** + * Selects documents in which this field has a value included in [range]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int? + * ) + * + * collection.find { + * User::age isIn (25..50) + * } + * ``` + * + * @see gte Only specify the lower bound. + * @see lte Only specify the higher bound. + */ + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @JvmName("isInSimple") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable, R> kotlin.reflect.KProperty1.isIn(range: R) where R : ClosedRange, R : OpenEndRange { return this.field.isIn(range) } @@ -1846,21 +2313,14 @@ * ) * * collection.find { - * User::name.isOneOf(listOf("Alfred", "Arthur")) + * User::name isOneOf listOf("Alfred", "Arthur") * } * ``` - * - * ### External resources - * - * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) - * - * @see or - * @see eq */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isOneOf(values: List) { - this { isOneOf(values) } + fun <@kotlin.internal.OnlyInputTypes V> Field.isOneOf(values: List, type: KType) { + this.invoke({ isOneOf(values) }, type) } /** @@ -1875,7 +2335,7 @@ * ) * * collection.find { - * User::name.isOneOf(listOf("Alfred", "Arthur")) + * User::name isOneOf listOf("Alfred", "Arthur") * } * ``` * @@ -1886,9 +2346,38 @@ * @see or * @see eq */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.isOneOf(values: List) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.isOneOf(values: List) { + this.isOneOf(values, typeOf()) + } + + /** + * Selects documents for which this field is equal to one of the given [values]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::name isOneOf listOf("Alfred", "Arthur") + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/in/) + * + * @see or + * @see eq + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.isOneOf(values: List) { return this.field.isOneOf(values) } @@ -1904,7 +2393,7 @@ * ) * * collection.find { - * User::name.isOneOf("Alfred", "Arthur") + * User::name.isOneOf(listOf("Alfred", "Arthur")) * } * ``` * @@ -1915,10 +2404,10 @@ * @see or * @see eq */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isOneOf(vararg values: V) { - isOneOf(values.asList()) + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.isOneOf(vararg values: V) { + this.isOneOf(values.asList()) } /** @@ -1933,7 +2422,7 @@ * ) * * collection.find { - * User::name.isOneOf("Alfred", "Arthur") + * User::name.isOneOf(listOf("Alfred", "Arthur")) * } * ``` * @@ -1944,9 +2433,9 @@ * @see or * @see eq */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.isOneOf(vararg values: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.isOneOf(vararg values: V) { return this.field.isOneOf(*values) } @@ -1964,7 +2453,7 @@ * ) * * collection.find { - * User::name.isNotOneOf(listOf("Alfred", "Arthur")) + * User::name isNotOneOf listOf("Alfred", "Arthur") * } * ``` * @@ -1977,8 +2466,8 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isNotOneOf(values: List) { - this { isNotOneOf(values) } + fun <@kotlin.internal.OnlyInputTypes V> Field.isNotOneOf(values: List, type: KType) { + this.invoke({ isNotOneOf(values) }, type) } /** @@ -1995,7 +2484,7 @@ * ) * * collection.find { - * User::name.isNotOneOf(listOf("Alfred", "Arthur")) + * User::name isNotOneOf listOf("Alfred", "Arthur") * } * ``` * @@ -2006,9 +2495,40 @@ * @see isOneOf * @see ne */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.isNotOneOf(values: List) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.isNotOneOf(values: List) { + this.isNotOneOf(values, typeOf()) + } + + /** + * Selects documents for which this field is not equal to any of the given [values]. + * + * This operator will also select documents for which the field doesn't exist. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int?, + * ) + * + * collection.find { + * User::name isNotOneOf listOf("Alfred", "Arthur") + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/nin/) + * + * @see isOneOf + * @see ne + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.isNotOneOf(values: List) { return this.field.isNotOneOf(values) } @@ -2037,9 +2557,9 @@ * @see isOneOf * @see ne */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.isNotOneOf(vararg values: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.isNotOneOf(vararg values: V) { isNotOneOf(values.asList()) } @@ -2068,9 +2588,9 @@ * @see isOneOf * @see ne */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.isNotOneOf(vararg values: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.isNotOneOf(vararg values: V) { return this.field.isNotOneOf(*values) } @@ -2417,7 +2937,7 @@ */ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl - fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit) + fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit, type: KType) /** * Specify multiple operators on a single array element. @@ -2468,8 +2988,64 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/) */ @OptIn(LowLevelApi::class, DangerousMongoApi::class) + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun kotlin.reflect.KProperty1>.anyValue(block: FilterQueryPredicate.() -> Unit) { + final inline fun Field>.anyValue(noinline block: FilterQueryPredicate.() -> Unit) { + this.anyValue(block, typeOf()) + } + + /** + * Specify multiple operators on a single array element. + * + * ### Example + * + * Find students with a grade between 8 and 10, that may be eligible to perform + * an exam a second time. + * + * ```kotlin + * class Student( + * val name: String, + * val grades: List + * ) + * + * collection.find { + * Student::grades.anyValue { + * gte(8) + * lte(10) + * } + * } + * ``` + * + * The following document will match because the grade 9 is in the interval. + * ```json + * { + * "name": "John", + * "grades": [9, 3] + * } + * ``` + * + * The following document will NOT match, because none of the grades are in the interval. + * ```json + * { + * "name": "Lea", + * "grades": [18, 19] + * } + * ``` + * + * If you want to perform multiple checks on different elements of an array, + * see the [any] property. + * + * This function only allows specifying operators on array elements directly. + * To specify operators on sub-fields of array elements, see [any]. + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/) + */ + @OptIn(LowLevelApi::class, DangerousMongoApi::class) + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline fun kotlin.reflect.KProperty1>.anyValue(noinline block: FilterQueryPredicate.() -> Unit) { return this.field.anyValue(block) } @@ -2612,7 +3188,7 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/all/) */ @KtMongoDsl - infix fun Field>.containsAll(values: Collection) + fun Field>.containsAll(values: Collection, type: KType) /** * Selects documents where the value of a field is an array that contains all the specified [values]. @@ -2633,8 +3209,34 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/all/) */ + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun kotlin.reflect.KProperty1>.containsAll(values: Collection) { + final inline infix fun Field>.containsAll(values: Collection) { + this.containsAll(values, typeOf()) + } + + /** + * Selects documents where the value of a field is an array that contains all the specified [values]. + * + * ### Example + * + * ```kotlin + * class User( + * val grades: List + * ) + * + * collection.find { + * User::grades containsAll listOf(2, 3, 7) + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/query/all/) + */ + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun kotlin.reflect.KProperty1>.containsAll(values: Collection) { return this.field.containsAll(values) } diff --git a/dsl/src/commonMain/kotlin/query/FilterQueryImpl.kt b/dsl/src/commonMain/kotlin/query/FilterQueryImpl.kt --- a/dsl/src/commonMain/kotlin/query/FilterQueryImpl.kt +++ b/dsl/src/commonMain/kotlin/query/FilterQueryImpl.kt @@ -35,6 +35,7 @@ import opensavvy.ktmongo.dsl.tree.AbstractBsonNode import opensavvy.ktmongo.dsl.tree.AbstractCompoundBsonNode import opensavvy.ktmongo.dsl.tree.BsonNode +import kotlin.reflect.KType @KtMongoDsl private class FilterQueryImpl( @@ -178,8 +179,8 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override operator fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit) { - accept(PredicateInFilterBsonNode(path, FilterQueryPredicate(context).apply(block), context)) + override operator fun <@kotlin.internal.OnlyInputTypes V> Field.invoke(block: FilterQueryPredicate.() -> Unit, type: KType) { + accept(PredicateInFilterBsonNode(path, FilterQueryPredicate(context, type).apply(block), context)) } @LowLevelApi @@ -205,8 +206,8 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl - override fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit) { - accept(ElementMatchBsonNodeNode(this.path, FilterQueryPredicate(context).apply(block), context)) + override fun Field>.anyValue(block: FilterQueryPredicate.() -> Unit, type: KType) { + accept(ElementMatchBsonNodeNode(this.path, FilterQueryPredicate(context, type).apply(block), context)) } @OptIn(LowLevelApi::class, DangerousMongoApi::class) @@ -241,7 +242,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl - override infix fun Field>.containsAll(values: Collection) { + override fun Field>.containsAll(values: Collection, type: KType) { accept(ArrayAllBsonNodeNode(path, values, context)) } diff --git a/dsl/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt b/dsl/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt --- a/dsl/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt +++ b/dsl/src/commonMain/kotlin/query/FilterQueryPredicateImpl.kt @@ -31,6 +31,8 @@ import opensavvy.ktmongo.dsl.tree.AbstractBsonNode import opensavvy.ktmongo.dsl.tree.AbstractCompoundBsonNode import opensavvy.ktmongo.dsl.tree.BsonNode +import kotlin.reflect.KType +import kotlin.reflect.typeOf /** * Implementation of [FilterQueryPredicate]. @@ -38,6 +40,7 @@ @KtMongoDsl private class FilterQueryPredicateImpl( context: BsonContext, + val type: KType, ) : AbstractCompoundBsonNode(context), FilterQueryPredicate { // region Low-level operations @@ -142,7 +145,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @KtMongoDsl override fun not(expression: FilterQueryPredicate.() -> Unit) { - accept(NotPredicateBsonNodeNode(FilterQueryPredicateImpl(context).apply(expression), context)) + accept(NotPredicateBsonNodeNode(FilterQueryPredicateImpl(context, type).apply(expression), context)) } @LowLevelApi @@ -414,7 +417,25 @@ /** * Creates an empty [FilterQueryPredicate]. + * + * Users should generally not need to interact with this function, as KtMongo already provides an instance of + * [FilterQueryPredicate] in all contexts where one is useful. + * + * If calling this method, prefer the inline overload. + * + * @param type The [KType] instance that corresponds to type [T]. + * If [KType] doesn't correspond to [T], the behavior is unspecified. */ @LowLevelApi -fun FilterQueryPredicate(context: BsonContext): FilterQueryPredicate = - FilterQueryPredicateImpl(context) +fun FilterQueryPredicate(context: BsonContext, type: KType): FilterQueryPredicate = + FilterQueryPredicateImpl(context, type) + +/** + * Creates an empty [FilterQueryPredicate]. + * + * Users should generally not need to interact with this function, as KtMongo already provides an instance of + * [FilterQueryPredicate] in all contexts where one is useful. + */ +@LowLevelApi +inline fun FilterQueryPredicate(context: BsonContext): FilterQueryPredicate = + FilterQueryPredicate(context, typeOf()) diff --git a/dsl/src/commonMain/kotlin/query/UpdateQuery.kt b/dsl/src/commonMain/kotlin/query/UpdateQuery.kt --- a/dsl/src/commonMain/kotlin/query/UpdateQuery.kt +++ b/dsl/src/commonMain/kotlin/query/UpdateQuery.kt @@ -25,6 +25,8 @@ import opensavvy.ktmongo.dsl.LowLevelApi import opensavvy.ktmongo.dsl.path.* import opensavvy.ktmongo.dsl.tree.CompoundBsonNode +import kotlin.reflect.KType +import kotlin.reflect.typeOf import kotlin.time.Instant /** @@ -107,7 +109,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V) + fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V, type: KType) /** * Replaces the value of a field with the specified [value]. @@ -133,9 +135,39 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.set(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.set(value: V) { + set(value, typeOf()) + } + + /** + * Replaces the value of a field with the specified [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.filter { + * User::name eq "foo" + * }.updateMany { + * User::age set 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/set/) + * + * @see UpsertQuery.setOnInsert Only set if a new document is created. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.set(value: V) { return this.field.set(value) } @@ -165,9 +197,9 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setIf(condition: Boolean, value: V) { if (condition) this set value } @@ -198,9 +230,9 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: V) { return this.field.setIf(condition, value) } @@ -230,9 +262,9 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setUnless(condition: Boolean, value: V) { if (!condition) this set value } @@ -263,9 +295,9 @@ * * @see UpsertQuery.setOnInsert Only set if a new document is created. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: V) { + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: V) { return this.field.setUnless(condition, value) } @@ -302,7 +334,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V) + fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V, type: KType) /** * Increments a field by the specified [amount]. @@ -332,9 +364,43 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Number> kotlin.reflect.KProperty1.inc(amount: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.inc(amount: V) { + this.inc(amount, typeOf()) + } + + /** + * Increments a field by the specified [amount]. + * + * [amount] may be negative, in which case the field is decremented. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of [amount]. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * ) + * + * // It's the new year! + * collection.updateMany { + * User::age inc 1 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Number> kotlin.reflect.KProperty1.inc(amount: V) { return this.field.inc(amount) } @@ -366,9 +432,9 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun <@kotlin.internal.OnlyInputTypes V : Number> Field.plusAssign(amount: V): Unit = + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.plusAssign(amount: V): Unit = this.inc(amount) /** @@ -399,9 +465,9 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/inc/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun <@kotlin.internal.OnlyInputTypes V : Number> kotlin.reflect.KProperty1.plusAssign(amount: V): Unit { + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V : Number> kotlin.reflect.KProperty1.plusAssign(amount: V): Unit { return this.field.plusAssign(amount) } @@ -435,7 +501,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V) + fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V, type: KType) /** * Multiplies a field by the specified [amount]. @@ -462,10 +528,103 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/mul/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Number> kotlin.reflect.KProperty1.mul(amount: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.mul(amount: V) { + this.mul(amount, typeOf()) + } + + /** + * Multiplies a field by the specified [amount]. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of 0. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val price: Double, + * ) + * + * collection.updateMany { + * User::price mul 2.0 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/mul/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Number> kotlin.reflect.KProperty1.mul(amount: V) { return this.field.mul(amount) + } + + /** + * Multiplies a field by the specified [amount]. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of 0. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val price: Double, + * ) + * + * collection.updateMany { + * User::price *= 2.0 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/mul/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V : Number> Field.timesAssign(amount: V) { + this mul amount + } + + /** + * Multiplies a field by the specified [amount]. + * + * If the field doesn't exist (either the document doesn't have it, or the operation is an upsert and a new document is created), + * the field is created with an initial value of 0. + * + * Use of this operator with a field with a `null` value will generate an error. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val price: Double, + * ) + * + * collection.updateMany { + * User::price *= 2.0 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/mul/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline operator fun <@kotlin.internal.OnlyInputTypes reified V : Number> kotlin.reflect.KProperty1.timesAssign(amount: V) { + return this.field.timesAssign(amount) } // endregion @@ -556,7 +715,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V) + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V, type: KType) /** * Updates the value of a field to the specified [value] only if the specified [value] is less than the current value of the field. @@ -580,9 +739,37 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/min/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> kotlin.reflect.KProperty1.min(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.min(value: V) { + this.min(value, typeOf()) + } + + /** + * Updates the value of a field to the specified [value] only if the specified [value] is less than the current value of the field. + * + * If the field doesn't exist, the field is set to the specified [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val score: Int, + * ) + * + * collection.updateMany { + * User::score min 10 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/min/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> kotlin.reflect.KProperty1.min(value: V) { return this.field.min(value) } @@ -610,7 +797,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V) + fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V, type: KType) /** * Updates the value of a field to the specified [value] only if the specified [value] is greater than the current value of the field. @@ -634,9 +821,37 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/max/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> kotlin.reflect.KProperty1.max(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> Field.max(value: V) { + this.max(value, typeOf()) + } + + /** + * Updates the value of a field to the specified [value] only if the specified [value] is greater than the current value of the field. + * + * If the field doesn't exist, the field is set to the specified [value]. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val score: Int, + * ) + * + * collection.updateMany { + * User::score max 100 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/max/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V : Comparable> kotlin.reflect.KProperty1.max(value: V) { return this.field.max(value) } @@ -970,6 +1185,7 @@ @OptIn(LowLevelApi::class) val kotlin.reflect.KProperty1>.selected: Field get() = this.field.selected + // endregion // region All positional operator: $[] @@ -1070,7 +1286,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field>.addToSet(value: V) + fun <@kotlin.internal.OnlyInputTypes V> Field>.addToSet(value: V, type: KType) /** * Adds [value] at the end of the array, unless it is already present, in which case it does nothing. @@ -1102,9 +1318,45 @@ * * - [Official documentation](https://www.mongodb.com/docs/v7.0/reference/operator/update/addToSet/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1>.addToSet(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field>.addToSet(value: V) { + this.addToSet(value, typeOf()) + } + + /** + * Adds [value] at the end of the array, unless it is already present, in which case it does nothing. + * + * MongoDB detects equality if the two documents are exactly identical. All the fields must be the same _in the same order_. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * val tokens: List, + * ) + * + * collection.updateOne( + * filter = { + * User::name eq "Bob" + * }, + * update = { + * User::tokens addToSet "123456789" + * } + * ) + * ``` + * + * This will add `"123456789"` to the user's tokens only if it isn't already present. + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/v7.0/reference/operator/update/addToSet/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1>.addToSet(value: V) { return this.field.addToSet(value) } @@ -1133,7 +1385,7 @@ * User::name eq "Bob" * }, * update = { - * User::tokens addToSet listOf("123456789", "789456123") + * User::tokens addEachToSet listOf("123456789", "789456123") * } * ) * ``` @@ -1147,9 +1399,9 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field>.addToSet(values: Iterable) { + fun <@kotlin.internal.OnlyInputTypes V> Field>.addEachToSet(values: Iterable, type: KType) { for (value in values) - this addToSet value + this.addToSet(value, type) } /** @@ -1177,7 +1429,7 @@ * User::name eq "Bob" * }, * update = { - * User::tokens addToSet listOf("123456789", "789456123") + * User::tokens addEachToSet listOf("123456789", "789456123") * } * ) * ``` @@ -1189,10 +1441,53 @@ * * - [Official documentation](https://www.mongodb.com/docs/v7.0/reference/operator/update/addToSet/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1>.addToSet(values: Iterable) { - return this.field.addToSet(values) + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field>.addEachToSet(values: Iterable) { + this.addEachToSet(values, typeOf()) + } + + /** + * Adds multiple [values] at the end of the array, unless they are already present. + * + * Each value in [values] is treated independently. + * It if it is already present in the array, nothing happens. + * If it is absent from the array, it is added at the end. + * + * MongoDB detects equality if the two documents are exactly identical. All the fields must be the same _in the same order_. + * + * This is a convenience function for calling [addToSet] multiple times. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String, + * val age: Int, + * val tokens: List, + * ) + * + * collection.updateOne( + * filter = { + * User::name eq "Bob" + * }, + * update = { + * User::tokens addEachToSet listOf("123456789", "789456123") + * } + * ) + * ``` + * + * This will add `"123456789"` and `"789465123"` to the user's tokens only if they aren't already present. + * If only one of them is present, the other is added. + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/v7.0/reference/operator/update/addToSet/) + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1>.addEachToSet(values: Iterable) { + return this.field.addEachToSet(values) } // endregion @@ -1239,7 +1534,7 @@ */ @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V) + fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V, type: KType) /** * If an upsert operation results in an insert of a document, @@ -1267,9 +1562,41 @@ * * @see set Always set the value. */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setOnInsert(value: V) { + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> Field.setOnInsert(value: V) { + this.setOnInsert(value, typeOf()) + } + + /** + * If an upsert operation results in an insert of a document, + * then this operator assigns the specified [value] to the field. + * If the update operation does not result in an insert, this operator does nothing. + * + * ### Example + * + * ```kotlin + * class User( + * val name: String?, + * val age: Int, + * ) + * + * collection.filter { + * User::name eq "foo" + * }.upsertOne { + * User::age setOnInsert 18 + * } + * ``` + * + * ### External resources + * + * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/setOnInsert/) + * + * @see set Always set the value. + */ + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") + @KtMongoDsl + final inline infix fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setOnInsert(value: V) { return this.field.setOnInsert(value) } diff --git a/dsl/src/commonMain/kotlin/query/UpdateQueryImpl.kt b/dsl/src/commonMain/kotlin/query/UpdateQueryImpl.kt --- a/dsl/src/commonMain/kotlin/query/UpdateQueryImpl.kt +++ b/dsl/src/commonMain/kotlin/query/UpdateQueryImpl.kt @@ -36,6 +36,7 @@ import opensavvy.ktmongo.dsl.tree.BsonNode import opensavvy.ktmongo.dsl.tree.acceptAll import kotlin.reflect.KClass +import kotlin.reflect.KType import kotlin.time.Instant /** @@ -95,7 +96,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V, type: KType) { accept(SetBsonNodeNode(listOf(this.path to value), context)) } @@ -123,7 +124,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V> Field.setOnInsert(value: V, type: KType) { accept(SetOnInsertBsonNodeNode(listOf(this.path to value), context)) } @@ -150,7 +151,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Number> Field.inc(amount: V, type: KType) { accept(IncrementBsonNodeNode(listOf(this.path to amount), context)) } @@ -177,7 +178,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Number> Field.mul(amount: V, type: KType) { accept(MultiplyBsonNodeNode(listOf(this.path to amount), context)) } @@ -231,7 +232,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.min(value: V, type: KType) { accept(MinBsonNodeNode(listOf(this.path to value), context)) } @@ -258,7 +259,7 @@ @OptIn(LowLevelApi::class, DangerousMongoApi::class) @Suppress("INVISIBLE_REFERENCE") @KtMongoDsl - override infix fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V) { + override fun <@kotlin.internal.OnlyInputTypes V : Comparable> Field.max(value: V, type: KType) { accept(MaxBsonNodeNode(listOf(this.path to value), context)) } @@ -351,7 +352,7 @@ // region $setOnInsert @OptIn(DangerousMongoApi::class, LowLevelApi::class) - override fun Field>.addToSet(value: V) { + override fun Field>.addToSet(value: V, type: KType) { accept(AddToSetBsonNode(listOf(this.path to value), context)) } diff --git a/dsl/src/commonTest/kotlin/query/PredicateExpressionTest.kt b/dsl/src/commonTest/kotlin/query/PredicateExpressionTest.kt --- a/dsl/src/commonTest/kotlin/query/PredicateExpressionTest.kt +++ b/dsl/src/commonTest/kotlin/query/PredicateExpressionTest.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2025, OpenSavvy and contributors. + * Copyright (c) 2024-2026, OpenSavvy and contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,14 +22,15 @@ import opensavvy.prepared.runner.testballoon.preparedSuite @OptIn(LowLevelApi::class) -val PredicateExpressionTest by preparedSuite { +@KtMongoDsl +private inline fun predicate(block: FilterQueryPredicate.() -> Unit): String = + FilterQueryPredicate(testContext()) + .apply(block) + .toBson() + .toString() - @KtMongoDsl - fun predicate(block: FilterQueryPredicate.() -> Unit): String = - FilterQueryPredicate(testContext()) - .apply(block) - .toBson() - .toString() +@OptIn(LowLevelApi::class) +val PredicateExpressionTest by preparedSuite { suite($$"Operator $eq") { test("Integer") { diff --git a/dsl-template/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt b/dsl-template/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt --- a/dsl-template/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt +++ b/dsl-template/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt @@ -27,6 +27,8 @@ import opensavvy.ktmongo.dsl.path.FieldDsl import opensavvy.ktmongo.dsl.path.Path import kotlin.reflect.KProperty1 +import kotlin.reflect.KType +import kotlin.reflect.typeOf /** * Supertype for all interface operators describing operators on aggregation values. @@ -99,8 +101,30 @@ * ``` */ @OptIn(LowLevelApi::class) - fun of(value: Result): Value = + fun of(value: Result, type: KType): Value = LiteralValue(value, context) + + /** + * Refers to a Kotlin [value] within an [aggregation value][AggregationOperators]. + * + * ### Example + * + * ```kotlin + * class Product( + * val age: Int, + * ) + * + * val publishedBeforeAcceptance = products.find { + * expr { + * of(Product::age) lt of(15) + * } + * } + * ``` + */ + @OptIn(LowLevelApi::class) + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + final inline fun of(value: Result): Value = + of(value, typeOf()) /** * Refers to a [BsonType] within an [aggregation value][AggregationOperators]. diff --git a/dsl/src/commonMain/kotlin/aggregation/accumulators/ArithmeticValueAccumulators.kt b/dsl/src/commonMain/kotlin/aggregation/accumulators/ArithmeticValueAccumulators.kt --- a/dsl/src/commonMain/kotlin/aggregation/accumulators/ArithmeticValueAccumulators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/accumulators/ArithmeticValueAccumulators.kt @@ -233,9 +233,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes T : Number> Field.sum(value: Number?) = + infix final inline fun <@kotlin.internal.OnlyInputTypes T : Number> Field.sum(value: Number?) = sum(of(value)) /** @@ -265,9 +265,9 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum) */ @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1.sum(value: Number?) = + infix final inline fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1.sum(value: Number?) = this.field.sum(of(value)) /** @@ -511,9 +511,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes T : Number> Field.average(value: Number?) = + infix final inline fun <@kotlin.internal.OnlyInputTypes T : Number> Field.average(value: Number?) = average(of(value)) /** @@ -545,9 +545,9 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg) */ @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1.average(value: Number?) = + infix final inline fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1.average(value: Number?) = this.field.average(of(value)) /** @@ -793,9 +793,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes T : Number> Field.median(value: Number?) = + infix final inline fun <@kotlin.internal.OnlyInputTypes T : Number> Field.median(value: Number?) = median(of(value)) /** @@ -827,9 +827,9 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/) */ @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1.median(value: Number?) = + infix final inline fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1.median(value: Number?) = this.field.median(of(value)) /** @@ -1090,9 +1090,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes T : Number> Field>.percentiles( + final inline fun <@kotlin.internal.OnlyInputTypes T : Number> Field>.percentiles( value: Number?, vararg percentiles: Double, ) = @@ -1127,9 +1127,9 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentiles/) */ @OptIn(DangerousMongoApi::class, LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1>.percentiles( + final inline fun <@kotlin.internal.OnlyInputTypes T : Number> kotlin.reflect.KProperty1>.percentiles( value: Number?, vararg percentiles: Double, ) = diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/ArithmeticValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/ArithmeticValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/ArithmeticValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/ArithmeticValueOperators.kt @@ -162,9 +162,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun abs(value: Result): Value = + final inline fun abs(value: Result): Value = abs(of(value)) // endregion @@ -284,9 +284,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Value.plus(other: Result): Value = + operator final inline fun Value.plus(other: Result): Value = this.plus(of(other)) /** @@ -404,9 +404,9 @@ */ @JvmName("plusFieldReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun opensavvy.ktmongo.dsl.path.Field.plus(other: Result): Value = + operator final inline fun opensavvy.ktmongo.dsl.path.Field.plus(other: Result): Value = of(this).plus(of(other)) /** @@ -524,9 +524,9 @@ */ @JvmName("plusPropertyReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun kotlin.reflect.KProperty1.plus(other: Result): Value = + operator final inline fun kotlin.reflect.KProperty1.plus(other: Result): Value = of(this).plus(of(other)) /** @@ -555,9 +555,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("plusResultReceiverByValue") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.plus(other: Value): Value = + operator final inline fun Result.plus(other: Value): Value = of(this).plus(other) /** @@ -586,9 +586,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("plusResultReceiverByField") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.plus(other: opensavvy.ktmongo.dsl.path.Field): Value = + operator final inline fun Result.plus(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).plus(of(other)) /** @@ -617,9 +617,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("plusResultReceiverByProperty") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.plus(other: kotlin.reflect.KProperty1): Value = + operator final inline fun Result.plus(other: kotlin.reflect.KProperty1): Value = of(this).plus(of(other)) /** @@ -648,9 +648,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("plusResultReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.plus(other: Result): Value = + operator final inline fun Result.plus(other: Result): Value = of(this).plus(of(other)) @OptIn(LowLevelApi::class) @@ -806,9 +806,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun ceil(value: Result): Value = + final inline fun ceil(value: Result): Value = ceil(of(value)) // endregion @@ -928,9 +928,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Value.times(other: Result): Value = + operator final inline fun Value.times(other: Result): Value = this.times(of(other)) /** @@ -1048,9 +1048,9 @@ */ @JvmName("timesFieldReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun opensavvy.ktmongo.dsl.path.Field.times(other: Result): Value = + operator final inline fun opensavvy.ktmongo.dsl.path.Field.times(other: Result): Value = of(this).times(of(other)) /** @@ -1168,9 +1168,9 @@ */ @JvmName("timesPropertyReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun kotlin.reflect.KProperty1.times(other: Result): Value = + operator final inline fun kotlin.reflect.KProperty1.times(other: Result): Value = of(this).times(of(other)) /** @@ -1199,9 +1199,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("timesResultReceiverByValue") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.times(other: Value): Value = + operator final inline fun Result.times(other: Value): Value = of(this).times(other) /** @@ -1230,9 +1230,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("timesResultReceiverByField") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.times(other: opensavvy.ktmongo.dsl.path.Field): Value = + operator final inline fun Result.times(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).times(of(other)) /** @@ -1261,9 +1261,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("timesResultReceiverByProperty") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.times(other: kotlin.reflect.KProperty1): Value = + operator final inline fun Result.times(other: kotlin.reflect.KProperty1): Value = of(this).times(of(other)) /** @@ -1292,9 +1292,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("timesResultReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.times(other: Result): Value = + operator final inline fun Result.times(other: Result): Value = of(this).times(of(other)) @OptIn(LowLevelApi::class) @@ -1426,9 +1426,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Value.div(other: Result): Value = + operator final inline fun Value.div(other: Result): Value = this.div(of(other)) /** @@ -1522,9 +1522,9 @@ */ @JvmName("divFieldReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun opensavvy.ktmongo.dsl.path.Field.div(other: Result): Value = + operator final inline fun opensavvy.ktmongo.dsl.path.Field.div(other: Result): Value = of(this).div(of(other)) /** @@ -1555,9 +1555,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("divResultReceiverByValue") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.div(other: Value): Value = + operator final inline fun Result.div(other: Value): Value = of(this).div(other) /** @@ -1588,9 +1588,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("divResultReceiverByField") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.div(other: opensavvy.ktmongo.dsl.path.Field): Value = + operator final inline fun Result.div(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).div(of(other)) /** @@ -1621,9 +1621,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("divResultReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.div(other: Result): Value = + operator final inline fun Result.div(other: Result): Value = of(this).div(of(other)) @OptIn(LowLevelApi::class) @@ -1773,9 +1773,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Value.minus(other: Result): Value = + operator final inline fun Value.minus(other: Result): Value = this.minus(of(other)) /** @@ -1905,9 +1905,9 @@ */ @JvmName("minusFieldReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun opensavvy.ktmongo.dsl.path.Field.minus(other: Result): Value = + operator final inline fun opensavvy.ktmongo.dsl.path.Field.minus(other: Result): Value = of(this).minus(of(other)) /** @@ -2037,9 +2037,9 @@ */ @JvmName("minusPropertyReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun kotlin.reflect.KProperty1.minus(other: Result): Value = + operator final inline fun kotlin.reflect.KProperty1.minus(other: Result): Value = of(this).minus(of(other)) /** @@ -2071,9 +2071,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("minusResultReceiverByValue") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.minus(other: Value): Value = + operator final inline fun Result.minus(other: Value): Value = of(this).minus(other) /** @@ -2105,9 +2105,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("minusResultReceiverByField") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.minus(other: opensavvy.ktmongo.dsl.path.Field): Value = + operator final inline fun Result.minus(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).minus(of(other)) /** @@ -2139,9 +2139,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("minusResultReceiverByProperty") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.minus(other: kotlin.reflect.KProperty1): Value = + operator final inline fun Result.minus(other: kotlin.reflect.KProperty1): Value = of(this).minus(of(other)) /** @@ -2173,9 +2173,9 @@ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("minusResultReceiverByResult") @OptIn(LowLevelApi::class) - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - operator fun Result.minus(other: Result): Value = + operator final inline fun Result.minus(other: Result): Value = of(this).minus(of(other)) @OptIn(LowLevelApi::class) @@ -2313,9 +2313,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @OptIn(LowLevelApi::class) - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun floor(value: Result): Value = + final inline fun floor(value: Result): Value = floor(of(value)) // endregion diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/ArrayValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/ArrayValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/ArrayValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/ArrayValueOperators.kt @@ -1179,10 +1179,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/#array-operator) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value>.take( + final inline fun Value>.take( limit: Number, ): Value> = this.take(of(limit)) @@ -1307,10 +1307,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/#array-operator) */ @JvmName("takeFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field>.take( + final inline fun opensavvy.ktmongo.dsl.path.Field>.take( limit: Number, ): Value> = of(this).take(of(limit)) @@ -1435,10 +1435,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/#array-operator) */ @JvmName("takePropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1>.take( + final inline fun kotlin.reflect.KProperty1>.take( limit: Number, ): Value> = of(this).take(of(limit)) @@ -1567,10 +1567,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("takeResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Collection.take( + final inline fun Collection.take( limit: Number, ): Value> = of(this).take(of(limit)) @@ -1722,10 +1722,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#array-operator) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value>.takeLast( + final inline fun Value>.takeLast( limit: Number, ): Value> = this.takeLast(of(limit)) @@ -1850,10 +1850,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#array-operator) */ @JvmName("takeLastFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field>.takeLast( + final inline fun opensavvy.ktmongo.dsl.path.Field>.takeLast( limit: Number, ): Value> = of(this).takeLast(of(limit)) @@ -1978,10 +1978,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#array-operator) */ @JvmName("takeLastPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1>.takeLast( + final inline fun kotlin.reflect.KProperty1>.takeLast( limit: Number, ): Value> = of(this).takeLast(of(limit)) @@ -2110,10 +2110,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("takeLastResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Collection.takeLast( + final inline fun Collection.takeLast( limit: Number, ): Value> = of(this).takeLast(of(limit)) diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/ComparisonValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/ComparisonValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/ComparisonValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/ComparisonValueOperators.kt @@ -171,10 +171,10 @@ * @see FilterQuery.eq Equivalent operator in regular queries. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.eq(other: Result): Value = + infix final inline fun Value.eq(other: Result): Value = this.eq(of(other)) /** @@ -315,10 +315,10 @@ * @see FilterQuery.eq Equivalent operator in regular queries. */ @JvmName("eqFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.eq(other: Result): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.eq(other: Result): Value = of(this).eq(of(other)) /** @@ -459,10 +459,10 @@ * @see FilterQuery.eq Equivalent operator in regular queries. */ @JvmName("eqPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.eq(other: Result): Value = + infix final inline fun kotlin.reflect.KProperty1.eq(other: Result): Value = of(this).eq(of(other)) /** @@ -496,10 +496,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("eqResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.eq(other: Value): Value = + infix final inline fun Result.eq(other: Value): Value = of(this).eq(other) /** @@ -533,10 +533,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("eqResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.eq(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun Result.eq(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).eq(of(other)) /** @@ -570,10 +570,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("eqResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.eq(other: kotlin.reflect.KProperty1): Value = + infix final inline fun Result.eq(other: kotlin.reflect.KProperty1): Value = of(this).eq(of(other)) /** @@ -607,10 +607,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("eqResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.eq(other: Result): Value = + infix final inline fun Result.eq(other: Result): Value = of(this).eq(of(other)) /** @@ -749,10 +749,10 @@ * @see FilterQuery.ne Equivalent operator in regular queries. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.ne(other: Result): Value = + infix final inline fun Value.ne(other: Result): Value = this.ne(of(other)) /** @@ -893,10 +893,10 @@ * @see FilterQuery.ne Equivalent operator in regular queries. */ @JvmName("neFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.ne(other: Result): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.ne(other: Result): Value = of(this).ne(of(other)) /** @@ -1037,10 +1037,10 @@ * @see FilterQuery.ne Equivalent operator in regular queries. */ @JvmName("nePropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.ne(other: Result): Value = + infix final inline fun kotlin.reflect.KProperty1.ne(other: Result): Value = of(this).ne(of(other)) /** @@ -1074,10 +1074,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("neResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.ne(other: Value): Value = + infix final inline fun Result.ne(other: Value): Value = of(this).ne(other) /** @@ -1111,10 +1111,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("neResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.ne(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun Result.ne(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).ne(of(other)) /** @@ -1148,10 +1148,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("neResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.ne(other: kotlin.reflect.KProperty1): Value = + infix final inline fun Result.ne(other: kotlin.reflect.KProperty1): Value = of(this).ne(of(other)) /** @@ -1185,10 +1185,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("neResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.ne(other: Result): Value = + infix final inline fun Result.ne(other: Result): Value = of(this).ne(of(other)) // TODO: document the other operators once 'project' is implemented, since the official examples use 'project' to demonstrate them @@ -1213,10 +1213,10 @@ this.gt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.gt(other: Result): Value = + infix final inline fun Value.gt(other: Result): Value = this.gt(of(other)) @JvmName("gtFieldReceiverByValue") @@ -1241,10 +1241,10 @@ of(this).gt(of(other)) @JvmName("gtFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.gt(other: Result): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.gt(other: Result): Value = of(this).gt(of(other)) @JvmName("gtPropertyReceiverByValue") @@ -1269,42 +1269,42 @@ of(this).gt(of(other)) @JvmName("gtPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.gt(other: Result): Value = + infix final inline fun kotlin.reflect.KProperty1.gt(other: Result): Value = of(this).gt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gtResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gt(other: Value): Value = + infix final inline fun Result.gt(other: Value): Value = of(this).gt(other) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gtResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gt(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun Result.gt(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).gt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gtResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gt(other: kotlin.reflect.KProperty1): Value = + infix final inline fun Result.gt(other: kotlin.reflect.KProperty1): Value = of(this).gt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gtResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gt(other: Result): Value = + infix final inline fun Result.gt(other: Result): Value = of(this).gt(of(other)) @OptIn(LowLevelApi::class) @@ -1327,10 +1327,10 @@ this.gte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.gte(other: Result): Value = + infix final inline fun Value.gte(other: Result): Value = this.gte(of(other)) @JvmName("gteFieldReceiverByValue") @@ -1355,10 +1355,10 @@ of(this).gte(of(other)) @JvmName("gteFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.gte(other: Result): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.gte(other: Result): Value = of(this).gte(of(other)) @JvmName("gtePropertyReceiverByValue") @@ -1383,42 +1383,42 @@ of(this).gte(of(other)) @JvmName("gtePropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.gte(other: Result): Value = + infix final inline fun kotlin.reflect.KProperty1.gte(other: Result): Value = of(this).gte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gteResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gte(other: Value): Value = + infix final inline fun Result.gte(other: Value): Value = of(this).gte(other) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gteResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gte(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun Result.gte(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).gte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gteResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gte(other: kotlin.reflect.KProperty1): Value = + infix final inline fun Result.gte(other: kotlin.reflect.KProperty1): Value = of(this).gte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("gteResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.gte(other: Result): Value = + infix final inline fun Result.gte(other: Result): Value = of(this).gte(of(other)) @OptIn(LowLevelApi::class) @@ -1441,10 +1441,10 @@ this.lt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.lt(other: Result): Value = + infix final inline fun Value.lt(other: Result): Value = this.lt(of(other)) @JvmName("ltFieldReceiverByValue") @@ -1469,10 +1469,10 @@ of(this).lt(of(other)) @JvmName("ltFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.lt(other: Result): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.lt(other: Result): Value = of(this).lt(of(other)) @JvmName("ltPropertyReceiverByValue") @@ -1497,42 +1497,42 @@ of(this).lt(of(other)) @JvmName("ltPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.lt(other: Result): Value = + infix final inline fun kotlin.reflect.KProperty1.lt(other: Result): Value = of(this).lt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("ltResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lt(other: Value): Value = + infix final inline fun Result.lt(other: Value): Value = of(this).lt(other) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("ltResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lt(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun Result.lt(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).lt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("ltResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lt(other: kotlin.reflect.KProperty1): Value = + infix final inline fun Result.lt(other: kotlin.reflect.KProperty1): Value = of(this).lt(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("ltResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lt(other: Result): Value = + infix final inline fun Result.lt(other: Result): Value = of(this).lt(of(other)) @OptIn(LowLevelApi::class) @@ -1555,10 +1555,10 @@ this.lte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.lte(other: Result): Value = + infix final inline fun Value.lte(other: Result): Value = this.lte(of(other)) @JvmName("lteFieldReceiverByValue") @@ -1583,10 +1583,10 @@ of(this).lte(of(other)) @JvmName("lteFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.lte(other: Result): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.lte(other: Result): Value = of(this).lte(of(other)) @JvmName("ltePropertyReceiverByValue") @@ -1611,42 +1611,42 @@ of(this).lte(of(other)) @JvmName("ltePropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.lte(other: Result): Value = + infix final inline fun kotlin.reflect.KProperty1.lte(other: Result): Value = of(this).lte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("lteResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lte(other: Value): Value = + infix final inline fun Result.lte(other: Value): Value = of(this).lte(other) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("lteResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lte(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun Result.lte(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).lte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("lteResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lte(other: kotlin.reflect.KProperty1): Value = + infix final inline fun Result.lte(other: kotlin.reflect.KProperty1): Value = of(this).lte(of(other)) @kotlin.internal.LowPriorityInOverloadResolution @JvmName("lteResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Result.lte(other: Result): Value = + infix final inline fun Result.lte(other: Result): Value = of(this).lte(of(other)) @OptIn(LowLevelApi::class) diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/ConditionalValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/ConditionalValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/ConditionalValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/ConditionalValueOperators.kt @@ -183,10 +183,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: Value, ifFalse: T, @@ -344,10 +344,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByValueByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: T, @@ -505,10 +505,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByValueByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: kotlin.reflect.KProperty1, ifFalse: T, @@ -545,10 +545,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: T, ifFalse: Value, @@ -586,10 +586,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByValueByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: T, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -627,10 +627,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByValueByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: T, ifFalse: kotlin.reflect.KProperty1, @@ -667,10 +667,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Value, ifTrue: T, ifFalse: T, @@ -828,10 +828,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByValueByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: Value, ifFalse: T, @@ -989,10 +989,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: T, @@ -1150,10 +1150,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: kotlin.reflect.KProperty1, ifFalse: T, @@ -1191,10 +1191,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByResultByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: T, ifFalse: Value, @@ -1232,10 +1232,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: T, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -1273,10 +1273,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: T, ifFalse: kotlin.reflect.KProperty1, @@ -1314,10 +1314,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByFieldByResultByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: opensavvy.ktmongo.dsl.path.Field, ifTrue: T, ifFalse: T, @@ -1475,10 +1475,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByValueByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: Value, ifFalse: T, @@ -1636,10 +1636,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: T, @@ -1797,10 +1797,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: kotlin.reflect.KProperty1, ifFalse: T, @@ -1838,10 +1838,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByResultByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: T, ifFalse: Value, @@ -1879,10 +1879,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: T, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -1920,10 +1920,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: T, ifFalse: kotlin.reflect.KProperty1, @@ -1961,10 +1961,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByPropertyByResultByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: kotlin.reflect.KProperty1, ifTrue: T, ifFalse: T, @@ -2001,10 +2001,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: Value, ifFalse: Value, @@ -2042,10 +2042,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByValueByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: Value, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -2083,10 +2083,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByValueByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: Value, ifFalse: kotlin.reflect.KProperty1, @@ -2123,10 +2123,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: Value, ifFalse: T, @@ -2164,10 +2164,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByFieldByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: Value, @@ -2205,10 +2205,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByFieldByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -2246,10 +2246,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByFieldByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: kotlin.reflect.KProperty1, @@ -2287,10 +2287,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: opensavvy.ktmongo.dsl.path.Field, ifFalse: T, @@ -2328,10 +2328,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByPropertyByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: kotlin.reflect.KProperty1, ifFalse: Value, @@ -2369,10 +2369,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByPropertyByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: kotlin.reflect.KProperty1, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -2410,10 +2410,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByPropertyByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: kotlin.reflect.KProperty1, ifFalse: kotlin.reflect.KProperty1, @@ -2451,10 +2451,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: kotlin.reflect.KProperty1, ifFalse: T, @@ -2491,10 +2491,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: T, ifFalse: Value, @@ -2532,10 +2532,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: T, ifFalse: opensavvy.ktmongo.dsl.path.Field, @@ -2573,10 +2573,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("condByResultByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: T, ifFalse: kotlin.reflect.KProperty1, @@ -2613,10 +2613,10 @@ * @see switch Specify multiple conditions. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cond( + final inline fun cond( condition: Boolean, ifTrue: T, ifFalse: T, @@ -2808,10 +2808,10 @@ * @see then Keyword to declare the different cases. */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl @OptIn(LowLevelApi::class) - fun switch( + final inline fun switch( vararg cases: Case, default: T, ): Value = @@ -2950,9 +2950,9 @@ * @see switch */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun Value.then(value: T): Case = + infix final inline fun Value.then(value: T): Case = this.then(of(value)) /** @@ -3082,9 +3082,9 @@ * @see switch */ @JvmName("thenFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.then(value: T): Case = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.then(value: T): Case = of(this).then(of(value)) /** @@ -3214,9 +3214,9 @@ * @see switch */ @JvmName("thenPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun kotlin.reflect.KProperty1.then(value: T): Case = + infix final inline fun kotlin.reflect.KProperty1.then(value: T): Case = of(this).then(of(value)) /** @@ -3248,9 +3248,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("thenResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun Boolean.then(value: Value): Case = + infix final inline fun Boolean.then(value: Value): Case = of(this).then(value) /** @@ -3282,9 +3282,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("thenResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun Boolean.then(value: opensavvy.ktmongo.dsl.path.Field): Case = + infix final inline fun Boolean.then(value: opensavvy.ktmongo.dsl.path.Field): Case = of(this).then(of(value)) /** @@ -3316,9 +3316,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("thenResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun Boolean.then(value: kotlin.reflect.KProperty1): Case = + infix final inline fun Boolean.then(value: kotlin.reflect.KProperty1): Case = of(this).then(of(value)) /** @@ -3350,9 +3350,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("thenResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun Boolean.then(value: T): Case = + infix final inline fun Boolean.then(value: T): Case = of(this).then(of(value)) @OptIn(LowLevelApi::class) diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/StringValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/StringValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/StringValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/StringValueOperators.kt @@ -147,10 +147,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trim(): Value = + final inline fun String?.trim(): Value = of(this).trim() /** @@ -282,10 +282,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trim(vararg characters: Char): Value = + final inline fun String?.trim(vararg characters: Char): Value = of(this).trim(*characters) /** @@ -428,10 +428,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.trim(characters: String?): Value = + final inline fun Value.trim(characters: String?): Value = this.trim(of(characters)) /** @@ -576,10 +576,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/) */ @JvmName("trimFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.trim(characters: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.trim(characters: String?): Value = of(this).trim(of(characters)) /** @@ -724,10 +724,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/) */ @JvmName("trimPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.trim(characters: String?): Value = + final inline fun kotlin.reflect.KProperty1.trim(characters: String?): Value = of(this).trim(of(characters)) /** @@ -762,10 +762,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trim(characters: Value): Value = + final inline fun String?.trim(characters: Value): Value = of(this).trim(characters) /** @@ -800,10 +800,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trim(characters: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.trim(characters: opensavvy.ktmongo.dsl.path.Field): Value = of(this).trim(of(characters)) /** @@ -838,10 +838,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trim(characters: kotlin.reflect.KProperty1): Value = + final inline fun String?.trim(characters: kotlin.reflect.KProperty1): Value = of(this).trim(of(characters)) /** @@ -876,10 +876,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trim(characters: String?): Value = + final inline fun String?.trim(characters: String?): Value = of(this).trim(of(characters)) // endregion @@ -994,10 +994,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimStartResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimStart(): Value = + final inline fun String?.trimStart(): Value = of(this).trimStart() /** @@ -1129,10 +1129,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimStartResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimStart(vararg characters: Char): Value = + final inline fun String?.trimStart(vararg characters: Char): Value = of(this).trimStart(*characters) /** @@ -1275,10 +1275,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.trimStart(characters: String?): Value = + final inline fun Value.trimStart(characters: String?): Value = this.trimStart(of(characters)) /** @@ -1423,10 +1423,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/) */ @JvmName("trimStartFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.trimStart(characters: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.trimStart(characters: String?): Value = of(this).trimStart(of(characters)) /** @@ -1571,10 +1571,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/) */ @JvmName("trimStartPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.trimStart(characters: String?): Value = + final inline fun kotlin.reflect.KProperty1.trimStart(characters: String?): Value = of(this).trimStart(of(characters)) /** @@ -1609,10 +1609,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimStartResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimStart(characters: Value): Value = + final inline fun String?.trimStart(characters: Value): Value = of(this).trimStart(characters) /** @@ -1647,10 +1647,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimStartResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimStart(characters: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.trimStart(characters: opensavvy.ktmongo.dsl.path.Field): Value = of(this).trimStart(of(characters)) /** @@ -1685,10 +1685,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimStartResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimStart(characters: kotlin.reflect.KProperty1): Value = + final inline fun String?.trimStart(characters: kotlin.reflect.KProperty1): Value = of(this).trimStart(of(characters)) /** @@ -1723,10 +1723,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimStartResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimStart(characters: String?): Value = + final inline fun String?.trimStart(characters: String?): Value = of(this).trimStart(of(characters)) // endregion @@ -1841,10 +1841,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimEndResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimEnd(): Value = + final inline fun String?.trimEnd(): Value = of(this).trimEnd() /** @@ -1976,10 +1976,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimEndResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimEnd(vararg characters: Char): Value = + final inline fun String?.trimEnd(vararg characters: Char): Value = of(this).trimEnd(*characters) /** @@ -2122,10 +2122,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.trimEnd(characters: String?): Value = + final inline fun Value.trimEnd(characters: String?): Value = this.trimEnd(of(characters)) /** @@ -2270,10 +2270,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/) */ @JvmName("trimEndFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.trimEnd(characters: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.trimEnd(characters: String?): Value = of(this).trimEnd(of(characters)) /** @@ -2418,10 +2418,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/) */ @JvmName("trimEndPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.trimEnd(characters: String?): Value = + final inline fun kotlin.reflect.KProperty1.trimEnd(characters: String?): Value = of(this).trimEnd(of(characters)) /** @@ -2456,10 +2456,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimEndResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimEnd(characters: Value): Value = + final inline fun String?.trimEnd(characters: Value): Value = of(this).trimEnd(characters) /** @@ -2494,10 +2494,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimEndResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimEnd(characters: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.trimEnd(characters: opensavvy.ktmongo.dsl.path.Field): Value = of(this).trimEnd(of(characters)) /** @@ -2532,10 +2532,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimEndResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimEnd(characters: kotlin.reflect.KProperty1): Value = + final inline fun String?.trimEnd(characters: kotlin.reflect.KProperty1): Value = of(this).trimEnd(of(characters)) /** @@ -2570,10 +2570,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("trimEndResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.trimEnd(characters: String?): Value = + final inline fun String?.trimEnd(characters: String?): Value = of(this).trimEnd(of(characters)) // endregion @@ -2688,10 +2688,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("lowercaseResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.lowercase(): Value = + final inline fun String?.lowercase(): Value = of(this).lowercase() // endregion @@ -2806,10 +2806,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("uppercaseResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.uppercase(): Value = + final inline fun String?.uppercase(): Value = of(this).uppercase() // endregion @@ -3321,10 +3321,10 @@ * @see substringUTF8 */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: Value, length: Int): Value = + final inline fun Value.substring(startIndex: Value, length: Int): Value = this.substring(startIndex, of(length)) /** @@ -3498,10 +3498,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = + final inline fun Value.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = this.substring(of(startIndex), of(length)) /** @@ -3675,10 +3675,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = + final inline fun Value.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = this.substring(of(startIndex), of(length)) /** @@ -3719,10 +3719,10 @@ * @see substringUTF8 */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: Int, length: Value): Value = + final inline fun Value.substring(startIndex: Int, length: Value): Value = this.substring(of(startIndex), length) /** @@ -3764,10 +3764,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun Value.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = this.substring(of(startIndex), of(length)) /** @@ -3809,10 +3809,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = + final inline fun Value.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = this.substring(of(startIndex), of(length)) /** @@ -3853,10 +3853,10 @@ * @see substringUTF8 */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substring(startIndex: Int, length: Int): Value = + final inline fun Value.substring(startIndex: Int, length: Int): Value = this.substring(of(startIndex), of(length)) /** @@ -4029,10 +4029,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Value, length: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Value, length: Int): Value = of(this).substring(startIndex, of(length)) /** @@ -4205,10 +4205,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -4381,10 +4381,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -4425,10 +4425,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: Value): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: Value): Value = of(this).substring(of(startIndex), length) /** @@ -4469,10 +4469,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substring(of(startIndex), of(length)) /** @@ -4513,10 +4513,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = of(this).substring(of(startIndex), of(length)) /** @@ -4557,10 +4557,10 @@ * @see substringUTF8 */ @JvmName("substringFieldReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substring(startIndex: Int, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -4733,10 +4733,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: Value, length: Int): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: Value, length: Int): Value = of(this).substring(startIndex, of(length)) /** @@ -4909,10 +4909,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5085,10 +5085,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5129,10 +5129,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: Value): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: Value): Value = of(this).substring(of(startIndex), length) /** @@ -5173,10 +5173,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5217,10 +5217,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5261,10 +5261,10 @@ * @see substringUTF8 */ @JvmName("substringPropertyReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: Int): Value = + final inline fun kotlin.reflect.KProperty1.substring(startIndex: Int, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5306,10 +5306,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByValueByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Value, length: Value): Value = + final inline fun String?.substring(startIndex: Value, length: Value): Value = of(this).substring(startIndex, length) /** @@ -5351,10 +5351,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByValueByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Value, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substring(startIndex: Value, length: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substring(startIndex, of(length)) /** @@ -5396,10 +5396,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByValueByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Value, length: kotlin.reflect.KProperty1): Value = + final inline fun String?.substring(startIndex: Value, length: kotlin.reflect.KProperty1): Value = of(this).substring(startIndex, of(length)) /** @@ -5441,10 +5441,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByValueByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Value, length: Int): Value = + final inline fun String?.substring(startIndex: Value, length: Int): Value = of(this).substring(startIndex, of(length)) /** @@ -5486,10 +5486,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByFieldByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Value): Value = + final inline fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Value): Value = of(this).substring(of(startIndex), length) /** @@ -5531,10 +5531,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByFieldByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5576,10 +5576,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByFieldByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: kotlin.reflect.KProperty1): Value = + final inline fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: kotlin.reflect.KProperty1): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5621,10 +5621,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = + final inline fun String?.substring(startIndex: opensavvy.ktmongo.dsl.path.Field, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5666,10 +5666,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByPropertyByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: Value): Value = + final inline fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: Value): Value = of(this).substring(of(startIndex), length) /** @@ -5711,10 +5711,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByPropertyByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5756,10 +5756,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByPropertyByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: kotlin.reflect.KProperty1): Value = + final inline fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: kotlin.reflect.KProperty1): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5801,10 +5801,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = + final inline fun String?.substring(startIndex: kotlin.reflect.KProperty1, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5846,10 +5846,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByResultByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Int, length: Value): Value = + final inline fun String?.substring(startIndex: Int, length: Value): Value = of(this).substring(of(startIndex), length) /** @@ -5891,10 +5891,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substring(startIndex: Int, length: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5936,10 +5936,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = + final inline fun String?.substring(startIndex: Int, length: kotlin.reflect.KProperty1): Value = of(this).substring(of(startIndex), of(length)) /** @@ -5981,10 +5981,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiverByResultByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(startIndex: Int, length: Int): Value = + final inline fun String?.substring(startIndex: Int, length: Int): Value = of(this).substring(of(startIndex), of(length)) /** @@ -6148,10 +6148,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substring(indexes: IntRange): Value = + final inline fun String?.substring(indexes: IntRange): Value = of(this).substring(indexes) // endregion @@ -6333,10 +6333,10 @@ * @see substring */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: Value, byteCount: Int): Value = + final inline fun Value.substringUTF8(startIndex: Value, byteCount: Int): Value = this.substringUTF8(startIndex, of(byteCount)) /** @@ -6518,10 +6518,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = + final inline fun Value.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = this.substringUTF8(of(startIndex), of(byteCount)) /** @@ -6703,10 +6703,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = + final inline fun Value.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = this.substringUTF8(of(startIndex), of(byteCount)) /** @@ -6749,10 +6749,10 @@ * @see substring */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: Int, byteCount: Value): Value = + final inline fun Value.substringUTF8(startIndex: Int, byteCount: Value): Value = this.substringUTF8(of(startIndex), byteCount) /** @@ -6796,10 +6796,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun Value.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = this.substringUTF8(of(startIndex), of(byteCount)) /** @@ -6843,10 +6843,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun Value.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = this.substringUTF8(of(startIndex), of(byteCount)) /** @@ -6889,10 +6889,10 @@ * @see substring */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.substringUTF8(startIndex: Int, byteCount: Int): Value = + final inline fun Value.substringUTF8(startIndex: Int, byteCount: Int): Value = this.substringUTF8(of(startIndex), of(byteCount)) /** @@ -7073,10 +7073,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Value, byteCount: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Value, byteCount: Int): Value = of(this).substringUTF8(startIndex, of(byteCount)) /** @@ -7257,10 +7257,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -7441,10 +7441,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -7487,10 +7487,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: Value): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: Value): Value = of(this).substringUTF8(of(startIndex), byteCount) /** @@ -7533,10 +7533,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -7579,10 +7579,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -7625,10 +7625,10 @@ * @see substring */ @JvmName("substringUTF8FieldReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: Int): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.substringUTF8(startIndex: Int, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -7809,10 +7809,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Value, byteCount: Int): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Value, byteCount: Int): Value = of(this).substringUTF8(startIndex, of(byteCount)) /** @@ -7993,10 +7993,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8177,10 +8177,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8223,10 +8223,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: Value): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: Value): Value = of(this).substringUTF8(of(startIndex), byteCount) /** @@ -8269,10 +8269,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8315,10 +8315,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8361,10 +8361,10 @@ * @see substring */ @JvmName("substringUTF8PropertyReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: Int): Value = + final inline fun kotlin.reflect.KProperty1.substringUTF8(startIndex: Int, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8408,10 +8408,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByValueByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Value, byteCount: Value): Value = + final inline fun String?.substringUTF8(startIndex: Value, byteCount: Value): Value = of(this).substringUTF8(startIndex, byteCount) /** @@ -8455,10 +8455,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByValueByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Value, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substringUTF8(startIndex: Value, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substringUTF8(startIndex, of(byteCount)) /** @@ -8502,10 +8502,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByValueByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Value, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun String?.substringUTF8(startIndex: Value, byteCount: kotlin.reflect.KProperty1): Value = of(this).substringUTF8(startIndex, of(byteCount)) /** @@ -8549,10 +8549,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByValueByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Value, byteCount: Int): Value = + final inline fun String?.substringUTF8(startIndex: Value, byteCount: Int): Value = of(this).substringUTF8(startIndex, of(byteCount)) /** @@ -8596,10 +8596,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByFieldByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Value): Value = + final inline fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Value): Value = of(this).substringUTF8(of(startIndex), byteCount) /** @@ -8643,10 +8643,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByFieldByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8690,10 +8690,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByFieldByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: kotlin.reflect.KProperty1): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8737,10 +8737,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = + final inline fun String?.substringUTF8(startIndex: opensavvy.ktmongo.dsl.path.Field, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8784,10 +8784,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByPropertyByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Value): Value = + final inline fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Value): Value = of(this).substringUTF8(of(startIndex), byteCount) /** @@ -8831,10 +8831,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByPropertyByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8878,10 +8878,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByPropertyByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: kotlin.reflect.KProperty1): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8925,10 +8925,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = + final inline fun String?.substringUTF8(startIndex: kotlin.reflect.KProperty1, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -8972,10 +8972,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByResultByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Int, byteCount: Value): Value = + final inline fun String?.substringUTF8(startIndex: Int, byteCount: Value): Value = of(this).substringUTF8(of(startIndex), byteCount) /** @@ -9019,10 +9019,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.substringUTF8(startIndex: Int, byteCount: opensavvy.ktmongo.dsl.path.Field): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -9066,10 +9066,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = + final inline fun String?.substringUTF8(startIndex: Int, byteCount: kotlin.reflect.KProperty1): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -9113,10 +9113,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiverByResultByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(startIndex: Int, byteCount: Int): Value = + final inline fun String?.substringUTF8(startIndex: Int, byteCount: Int): Value = of(this).substringUTF8(of(startIndex), of(byteCount)) /** @@ -9288,10 +9288,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("substringUTF8ResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.substringUTF8(indexes: IntRange): Value = + final inline fun String?.substringUTF8(indexes: IntRange): Value = of(this).substringUTF8(indexes) // endregion @@ -9421,10 +9421,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.split(delimiter: String): Value?> = + final inline fun Value.split(delimiter: String): Value?> = this.split(of(delimiter)) /** @@ -9553,10 +9553,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/) */ @JvmName("splitFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.split(delimiter: String): Value?> = + final inline fun opensavvy.ktmongo.dsl.path.Field.split(delimiter: String): Value?> = of(this).split(of(delimiter)) /** @@ -9685,10 +9685,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/) */ @JvmName("splitPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.split(delimiter: String): Value?> = + final inline fun kotlin.reflect.KProperty1.split(delimiter: String): Value?> = of(this).split(of(delimiter)) /** @@ -9719,10 +9719,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("splitResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String.split(delimiter: Value): Value?> = + final inline fun String.split(delimiter: Value): Value?> = of(this).split(delimiter) /** @@ -9753,10 +9753,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("splitResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String.split(delimiter: opensavvy.ktmongo.dsl.path.Field): Value?> = + final inline fun String.split(delimiter: opensavvy.ktmongo.dsl.path.Field): Value?> = of(this).split(of(delimiter)) /** @@ -9787,10 +9787,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("splitResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String.split(delimiter: kotlin.reflect.KProperty1): Value?> = + final inline fun String.split(delimiter: kotlin.reflect.KProperty1): Value?> = of(this).split(of(delimiter)) /** @@ -9821,10 +9821,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("splitResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String.split(delimiter: String): Value?> = + final inline fun String.split(delimiter: String): Value?> = of(this).split(of(delimiter)) // endregion @@ -9950,10 +9950,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: Value, replacement: String?): Value = + final inline fun Value.replaceFirst(find: Value, replacement: String?): Value = this.replaceFirst(find, of(replacement)) /** @@ -10079,10 +10079,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun Value.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = this.replaceFirst(of(find), of(replacement)) /** @@ -10208,10 +10208,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun Value.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = this.replaceFirst(of(find), of(replacement)) /** @@ -10240,10 +10240,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: String?, replacement: Value): Value = + final inline fun Value.replaceFirst(find: String?, replacement: Value): Value = this.replaceFirst(of(find), replacement) /** @@ -10273,10 +10273,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun Value.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = this.replaceFirst(of(find), of(replacement)) /** @@ -10306,10 +10306,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun Value.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = this.replaceFirst(of(find), of(replacement)) /** @@ -10338,10 +10338,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replaceFirst(find: String?, replacement: String?): Value = + final inline fun Value.replaceFirst(find: String?, replacement: String?): Value = this.replaceFirst(of(find), of(replacement)) /** @@ -10466,10 +10466,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: Value, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: Value, replacement: String?): Value = of(this).replaceFirst(find, of(replacement)) /** @@ -10594,10 +10594,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -10722,10 +10722,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -10754,10 +10754,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: Value): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: Value): Value = of(this).replaceFirst(of(find), replacement) /** @@ -10786,10 +10786,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -10818,10 +10818,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -10850,10 +10850,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstFieldReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replaceFirst(find: String?, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -10978,10 +10978,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: Value, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: Value, replacement: String?): Value = of(this).replaceFirst(find, of(replacement)) /** @@ -11106,10 +11106,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11234,10 +11234,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11266,10 +11266,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: Value): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: Value): Value = of(this).replaceFirst(of(find), replacement) /** @@ -11298,10 +11298,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11330,10 +11330,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11362,10 +11362,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/) */ @JvmName("replaceFirstPropertyReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replaceFirst(find: String?, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11395,10 +11395,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByValueByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: Value, replacement: Value): Value = + final inline fun String?.replaceFirst(find: Value, replacement: Value): Value = of(this).replaceFirst(find, replacement) /** @@ -11428,10 +11428,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByValueByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: Value, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replaceFirst(find: Value, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replaceFirst(find, of(replacement)) /** @@ -11461,10 +11461,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByValueByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: Value, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replaceFirst(find: Value, replacement: kotlin.reflect.KProperty1): Value = of(this).replaceFirst(find, of(replacement)) /** @@ -11494,10 +11494,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByValueByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: Value, replacement: String?): Value = + final inline fun String?.replaceFirst(find: Value, replacement: String?): Value = of(this).replaceFirst(find, of(replacement)) /** @@ -11527,10 +11527,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByFieldByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: Value): Value = + final inline fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: Value): Value = of(this).replaceFirst(of(find), replacement) /** @@ -11560,10 +11560,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByFieldByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11593,10 +11593,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByFieldByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: kotlin.reflect.KProperty1): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11626,10 +11626,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun String?.replaceFirst(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11659,10 +11659,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByPropertyByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: Value): Value = + final inline fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: Value): Value = of(this).replaceFirst(of(find), replacement) /** @@ -11692,10 +11692,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByPropertyByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11725,10 +11725,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByPropertyByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: kotlin.reflect.KProperty1): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11758,10 +11758,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun String?.replaceFirst(find: kotlin.reflect.KProperty1, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11791,10 +11791,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByResultByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: String?, replacement: Value): Value = + final inline fun String?.replaceFirst(find: String?, replacement: Value): Value = of(this).replaceFirst(of(find), replacement) /** @@ -11824,10 +11824,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replaceFirst(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11857,10 +11857,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replaceFirst(find: String?, replacement: kotlin.reflect.KProperty1): Value = of(this).replaceFirst(of(find), of(replacement)) /** @@ -11890,10 +11890,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceFirstResultReceiverByResultByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replaceFirst(find: String?, replacement: String?): Value = + final inline fun String?.replaceFirst(find: String?, replacement: String?): Value = of(this).replaceFirst(of(find), of(replacement)) // endregion @@ -12019,10 +12019,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: Value, replacement: String?): Value = + final inline fun Value.replace(find: Value, replacement: String?): Value = this.replace(find, of(replacement)) /** @@ -12148,10 +12148,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun Value.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = this.replace(of(find), of(replacement)) /** @@ -12277,10 +12277,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun Value.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = this.replace(of(find), of(replacement)) /** @@ -12309,10 +12309,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: String?, replacement: Value): Value = + final inline fun Value.replace(find: String?, replacement: Value): Value = this.replace(of(find), replacement) /** @@ -12342,10 +12342,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun Value.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = this.replace(of(find), of(replacement)) /** @@ -12375,10 +12375,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun Value.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = this.replace(of(find), of(replacement)) /** @@ -12407,10 +12407,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Value.replace(find: String?, replacement: String?): Value = + final inline fun Value.replace(find: String?, replacement: String?): Value = this.replace(of(find), of(replacement)) /** @@ -12535,10 +12535,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: Value, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: Value, replacement: String?): Value = of(this).replace(find, of(replacement)) /** @@ -12663,10 +12663,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -12791,10 +12791,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -12823,10 +12823,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: Value): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: Value): Value = of(this).replace(of(find), replacement) /** @@ -12855,10 +12855,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replace(of(find), of(replacement)) /** @@ -12887,10 +12887,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = of(this).replace(of(find), of(replacement)) /** @@ -12919,10 +12919,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replaceFieldReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: String?): Value = + final inline fun opensavvy.ktmongo.dsl.path.Field.replace(find: String?, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -13047,10 +13047,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByValueByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: Value, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: Value, replacement: String?): Value = of(this).replace(find, of(replacement)) /** @@ -13175,10 +13175,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -13303,10 +13303,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -13335,10 +13335,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByResultByValue") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: String?, replacement: Value): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: String?, replacement: Value): Value = of(this).replace(of(find), replacement) /** @@ -13367,10 +13367,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replace(of(find), of(replacement)) /** @@ -13399,10 +13399,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = of(this).replace(of(find), of(replacement)) /** @@ -13431,10 +13431,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/) */ @JvmName("replacePropertyReceiverByResultByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun kotlin.reflect.KProperty1.replace(find: String?, replacement: String?): Value = + final inline fun kotlin.reflect.KProperty1.replace(find: String?, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -13464,10 +13464,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByValueByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: Value, replacement: Value): Value = + final inline fun String?.replace(find: Value, replacement: Value): Value = of(this).replace(find, replacement) /** @@ -13497,10 +13497,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByValueByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: Value, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replace(find: Value, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replace(find, of(replacement)) /** @@ -13530,10 +13530,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByValueByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: Value, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replace(find: Value, replacement: kotlin.reflect.KProperty1): Value = of(this).replace(find, of(replacement)) /** @@ -13563,10 +13563,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByValueByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: Value, replacement: String?): Value = + final inline fun String?.replace(find: Value, replacement: String?): Value = of(this).replace(find, of(replacement)) /** @@ -13596,10 +13596,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByFieldByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: Value): Value = + final inline fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: Value): Value = of(this).replace(of(find), replacement) /** @@ -13629,10 +13629,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByFieldByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replace(of(find), of(replacement)) /** @@ -13662,10 +13662,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByFieldByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: kotlin.reflect.KProperty1): Value = of(this).replace(of(find), of(replacement)) /** @@ -13695,10 +13695,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByFieldByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = + final inline fun String?.replace(find: opensavvy.ktmongo.dsl.path.Field, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -13728,10 +13728,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByPropertyByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: kotlin.reflect.KProperty1, replacement: Value): Value = + final inline fun String?.replace(find: kotlin.reflect.KProperty1, replacement: Value): Value = of(this).replace(of(find), replacement) /** @@ -13761,10 +13761,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByPropertyByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: kotlin.reflect.KProperty1, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replace(find: kotlin.reflect.KProperty1, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replace(of(find), of(replacement)) /** @@ -13794,10 +13794,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByPropertyByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: kotlin.reflect.KProperty1, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replace(find: kotlin.reflect.KProperty1, replacement: kotlin.reflect.KProperty1): Value = of(this).replace(of(find), of(replacement)) /** @@ -13827,10 +13827,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByPropertyByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = + final inline fun String?.replace(find: kotlin.reflect.KProperty1, replacement: String?): Value = of(this).replace(of(find), of(replacement)) /** @@ -13860,10 +13860,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByResultByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: String?, replacement: Value): Value = + final inline fun String?.replace(find: String?, replacement: Value): Value = of(this).replace(of(find), replacement) /** @@ -13893,10 +13893,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByResultByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = + final inline fun String?.replace(find: String?, replacement: opensavvy.ktmongo.dsl.path.Field): Value = of(this).replace(of(find), of(replacement)) /** @@ -13926,10 +13926,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByResultByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = + final inline fun String?.replace(find: String?, replacement: kotlin.reflect.KProperty1): Value = of(this).replace(of(find), of(replacement)) /** @@ -13959,10 +13959,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("replaceResultReceiverByResultByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun String?.replace(find: String?, replacement: String?): Value = + final inline fun String?.replace(find: String?, replacement: String?): Value = of(this).replace(of(find), of(replacement)) // endregion @@ -14372,10 +14372,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun Value.concat(other: String?): Value = + infix final inline fun Value.concat(other: String?): Value = this.concat(of(other)) /** @@ -14500,10 +14500,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/) */ @JvmName("concatFieldReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun opensavvy.ktmongo.dsl.path.Field.concat(other: String?): Value = + infix final inline fun opensavvy.ktmongo.dsl.path.Field.concat(other: String?): Value = of(this).concat(of(other)) /** @@ -14628,10 +14628,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/) */ @JvmName("concatPropertyReceiverByResult") - @Suppress("INAPPLICABLE_JVM_NAME") + @Suppress("INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun kotlin.reflect.KProperty1.concat(other: String?): Value = + infix final inline fun kotlin.reflect.KProperty1.concat(other: String?): Value = of(this).concat(of(other)) /** @@ -14661,10 +14661,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("concatResultReceiverByValue") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun String?.concat(other: Value): Value = + infix final inline fun String?.concat(other: Value): Value = of(this).concat(other) /** @@ -14694,10 +14694,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("concatResultReceiverByField") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun String?.concat(other: opensavvy.ktmongo.dsl.path.Field): Value = + infix final inline fun String?.concat(other: opensavvy.ktmongo.dsl.path.Field): Value = of(this).concat(of(other)) /** @@ -14727,10 +14727,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("concatResultReceiverByProperty") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun String?.concat(other: kotlin.reflect.KProperty1): Value = + infix final inline fun String?.concat(other: kotlin.reflect.KProperty1): Value = of(this).concat(of(other)) /** @@ -14760,10 +14760,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("concatResultReceiverByResult") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - infix fun String?.concat(other: String?): Value = + infix final inline fun String?.concat(other: String?): Value = of(this).concat(of(other)) @LowLevelApi diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/TrigonometryValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/TrigonometryValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/TrigonometryValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/TrigonometryValueOperators.kt @@ -168,10 +168,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun acos(value: Double?): Value = + final inline fun acos(value: Double?): Value = acos(of(value)) /** @@ -298,10 +298,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/acosh/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun acosh(value: Double?): Value = + final inline fun acosh(value: Double?): Value = acosh(of(value)) /** @@ -428,10 +428,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cos/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cos(value: Double?): Value = + final inline fun cos(value: Double?): Value = cos(of(value)) /** @@ -550,10 +550,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cosh/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun cosh(value: Double?): Value = + final inline fun cosh(value: Double?): Value = cosh(of(value)) /** @@ -688,10 +688,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun asin(value: Double?): Value = + final inline fun asin(value: Double?): Value = asin(of(value)) /** @@ -810,10 +810,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/asinh/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun asinh(value: Double?): Value = + final inline fun asinh(value: Double?): Value = asinh(of(value)) /** @@ -940,10 +940,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/sin/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun sin(value: Double?): Value = + final inline fun sin(value: Double?): Value = sin(of(value)) /** @@ -1062,10 +1062,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/sinh/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun sinh(value: Double?): Value = + final inline fun sinh(value: Double?): Value = sinh(of(value)) /** @@ -1192,10 +1192,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun atan(value: Double?): Value = + final inline fun atan(value: Double?): Value = atan(of(value)) /** @@ -1322,10 +1322,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun atanh(value: Double?): Value = + final inline fun atanh(value: Double?): Value = atanh(of(value)) /** @@ -1452,10 +1452,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/tan/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun tan(value: Double?): Value = + final inline fun tan(value: Double?): Value = tan(of(value)) /** @@ -1574,10 +1574,10 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/aggregation/tanh/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun tanh(value: Double?): Value = + final inline fun tanh(value: Double?): Value = tanh(of(value)) // endregion @@ -1700,10 +1700,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toRadiansResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Double.toRadians(): Value = + final inline fun Double.toRadians(): Value = of(this).toRadians() /** @@ -1823,10 +1823,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toDegreesResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Double.toDegrees(): Value = + final inline fun Double.toDegrees(): Value = of(this).toDegrees() // endregion diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/TypeValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/TypeValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/TypeValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/TypeValueOperators.kt @@ -599,10 +599,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toBooleanResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toBoolean(): Value = + final inline fun Any?.toBoolean(): Value = of(this).toBoolean() /** @@ -830,10 +830,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toInstantResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toInstant(): Value = + final inline fun Any?.toInstant(): Value = of(this).toInstant() /** @@ -1037,10 +1037,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toDoubleResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toDouble(): Value = + final inline fun Any?.toDouble(): Value = of(this).toDouble() /** @@ -1248,10 +1248,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toIntResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toInt(): Value = + final inline fun Any?.toInt(): Value = of(this).toInt() /** @@ -1455,10 +1455,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toLongResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toLong(): Value = + final inline fun Any?.toLong(): Value = of(this).toLong() /** @@ -1614,10 +1614,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toObjectIdResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toObjectId(): Value = + final inline fun Any?.toObjectId(): Value = of(this).toObjectId() /** @@ -1793,10 +1793,10 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toTextResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toText(): Value = + final inline fun Any?.toText(): Value = of(this).toText() /** @@ -1923,11 +1923,11 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("toUuidResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @ExperimentalUuidApi @OptIn(LowLevelApi::class) @KtMongoDsl - fun Any?.toUuid(): Value = + final inline fun Any?.toUuid(): Value = of(this).toUuid() @LowLevelApi diff --git a/dsl/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt b/dsl/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt --- a/dsl/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt +++ b/dsl/src/commonMain/kotlin/aggregation/operators/ValueOperators.kt @@ -30,6 +30,8 @@ import opensavvy.ktmongo.dsl.path.FieldDsl import opensavvy.ktmongo.dsl.path.Path import kotlin.reflect.KProperty1 +import kotlin.reflect.KType +import kotlin.reflect.typeOf /** * Supertype for all interface operators describing operators on aggregation values. @@ -102,8 +104,30 @@ * ``` */ @OptIn(LowLevelApi::class) - fun of(value: Result): Value = + fun of(value: Result, type: KType): Value = LiteralValue(value, context) + + /** + * Refers to a Kotlin [value] within an [aggregation value][AggregationOperators]. + * + * ### Example + * + * ```kotlin + * class Product( + * val age: Int, + * ) + * + * val publishedBeforeAcceptance = products.find { + * expr { + * of(Product::age) lt of(15) + * } + * } + * ``` + */ + @OptIn(LowLevelApi::class) + @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") + final inline fun of(value: Result): Value = + of(value, typeOf()) /** * Refers to a [BsonType] within an [aggregation value][AggregationOperators]. @@ -213,9 +237,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("divResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") @OptIn(LowLevelApi::class) - operator fun Root.div(field: Field): Value = + operator final inline fun Root.div(field: Field): Value = of(this).div(field) /** @@ -303,8 +327,8 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("divResultReceiver") - @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME") - operator fun Root.div(field: KProperty1): Value = + @Suppress("INVISIBLE_REFERENCE", "INAPPLICABLE_JVM_NAME", "WRONG_MODIFIER_CONTAINING_DECLARATION") + operator final inline fun Root.div(field: KProperty1): Value = of(this).div(field) } diff --git a/dsl/src/commonMain/kotlin/aggregation/stages/Set.kt b/dsl/src/commonMain/kotlin/aggregation/stages/Set.kt --- a/dsl/src/commonMain/kotlin/aggregation/stages/Set.kt +++ b/dsl/src/commonMain/kotlin/aggregation/stages/Set.kt @@ -151,9 +151,9 @@ * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/set/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> Field.set(value: V) = + infix final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.set(value: V) = set(of(value)) /** @@ -163,9 +163,9 @@ * * - [Official documentation](https://www.mongodb.com/docs/manual/reference/operator/update/set/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - infix fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.set(value: V) = + infix final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.set(value: V) = this.field.set(of(value)) /** @@ -274,9 +274,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Value, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setIf(condition: Value, value: V) = setIf(condition, of(value)) /** @@ -289,9 +289,9 @@ * - [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/) * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Value, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setIf(condition: Value, value: V) = this.field.setIf(condition, of(value)) /** @@ -402,9 +402,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setIfByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setIf(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = setIf(of(condition), of(value)) /** @@ -418,9 +418,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setIfPropertyReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setIf(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = this.field.setIf(of(condition), of(value)) /** @@ -531,9 +531,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setIfByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: kotlin.reflect.KProperty1, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setIf(condition: kotlin.reflect.KProperty1, value: V) = setIf(of(condition), of(value)) /** @@ -547,9 +547,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setIfPropertyReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: kotlin.reflect.KProperty1, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setIf(condition: kotlin.reflect.KProperty1, value: V) = this.field.setIf(of(condition), of(value)) /** @@ -563,9 +563,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: Value) = + final inline fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: Value) = setIf(of(condition), value) /** @@ -578,9 +578,9 @@ * - [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/) * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: Value) = + final inline fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: Value) = this.field.setIf(of(condition), value) /** @@ -595,9 +595,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setIfByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = + final inline fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = setIf(of(condition), of(value)) /** @@ -611,9 +611,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setIfPropertyReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = + final inline fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = this.field.setIf(of(condition), of(value)) /** @@ -628,9 +628,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setIfByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: kotlin.reflect.KProperty1) = + final inline fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: kotlin.reflect.KProperty1) = setIf(of(condition), of(value)) /** @@ -644,9 +644,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setIfPropertyReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: kotlin.reflect.KProperty1) = + final inline fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: kotlin.reflect.KProperty1) = this.field.setIf(of(condition), of(value)) /** @@ -660,9 +660,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setIf(condition: Boolean, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setIf(condition: Boolean, value: V) = setIf(of(condition), of(value)) /** @@ -675,9 +675,9 @@ * - [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/) * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setIf(condition: Boolean, value: V) = this.field.setIf(of(condition), of(value)) /** @@ -786,9 +786,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Value, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setUnless(condition: Value, value: V) = setUnless(condition, of(value)) /** @@ -801,9 +801,9 @@ * - [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/) * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Value, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setUnless(condition: Value, value: V) = this.field.setUnless(condition, of(value)) /** @@ -914,9 +914,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setUnlessByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setUnless(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = setUnless(of(condition), of(value)) /** @@ -930,9 +930,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setUnlessPropertyReceiverByFieldByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setUnless(condition: opensavvy.ktmongo.dsl.path.Field, value: V) = this.field.setUnless(of(condition), of(value)) /** @@ -1043,9 +1043,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setUnlessByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: kotlin.reflect.KProperty1, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setUnless(condition: kotlin.reflect.KProperty1, value: V) = setUnless(of(condition), of(value)) /** @@ -1059,9 +1059,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setUnlessPropertyReceiverByPropertyByResult") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: kotlin.reflect.KProperty1, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setUnless(condition: kotlin.reflect.KProperty1, value: V) = this.field.setUnless(of(condition), of(value)) /** @@ -1075,9 +1075,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: Value) = + final inline fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: Value) = setUnless(of(condition), value) /** @@ -1090,9 +1090,9 @@ * - [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/) * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: Value) = + final inline fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: Value) = this.field.setUnless(of(condition), value) /** @@ -1107,9 +1107,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setUnlessByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = + final inline fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = setUnless(of(condition), of(value)) /** @@ -1123,9 +1123,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setUnlessPropertyReceiverByResultByField") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = + final inline fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: opensavvy.ktmongo.dsl.path.Field) = this.field.setUnless(of(condition), of(value)) /** @@ -1140,9 +1140,9 @@ */ @kotlin.internal.LowPriorityInOverloadResolution @JvmName("setUnlessByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: kotlin.reflect.KProperty1) = + final inline fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: kotlin.reflect.KProperty1) = setUnless(of(condition), of(value)) /** @@ -1156,9 +1156,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @JvmName("setUnlessPropertyReceiverByResultByProperty") - @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE") + @Suppress("INAPPLICABLE_JVM_NAME", "INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: kotlin.reflect.KProperty1) = + final inline fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: kotlin.reflect.KProperty1) = this.field.setUnless(of(condition), of(value)) /** @@ -1172,9 +1172,9 @@ * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ @kotlin.internal.LowPriorityInOverloadResolution - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> Field.setUnless(condition: Boolean, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> Field.setUnless(condition: Boolean, value: V) = setUnless(of(condition), of(value)) /** @@ -1187,9 +1187,9 @@ * - [`$set`](https://www.mongodb.com/docs/manual/reference/operator/update/set/) * - [`$cond`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/) */ - @Suppress("INVISIBLE_REFERENCE") + @Suppress("INVISIBLE_REFERENCE", "WRONG_MODIFIER_CONTAINING_DECLARATION") @KtMongoDsl - fun <@kotlin.internal.OnlyInputTypes V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: V) = + final inline fun <@kotlin.internal.OnlyInputTypes reified V> kotlin.reflect.KProperty1.setUnless(condition: Boolean, value: V) = this.field.setUnless(of(condition), of(value)) /** diff --git a/dsl/src/commonTest/kotlin/query/update/FieldUpdateTest.kt b/dsl/src/commonTest/kotlin/query/update/FieldUpdateTest.kt --- a/dsl/src/commonTest/kotlin/query/update/FieldUpdateTest.kt +++ b/dsl/src/commonTest/kotlin/query/update/FieldUpdateTest.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2025, OpenSavvy and contributors. + * Copyright (c) 2024-2026, OpenSavvy and contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -379,7 +379,7 @@ test("Add multiple values to the same field using a list") { update { - User::tokens addToSet listOf("123", "456") + User::tokens addEachToSet listOf("123", "456") } shouldBeBson $$""" { "$addToSet": { diff --git a/gradle/conventions/dsl-templator/src/main/kotlin/ApplyTemplateTask.kt b/gradle/conventions/dsl-templator/src/main/kotlin/ApplyTemplateTask.kt --- a/gradle/conventions/dsl-templator/src/main/kotlin/ApplyTemplateTask.kt +++ b/gradle/conventions/dsl-templator/src/main/kotlin/ApplyTemplateTask.kt @@ -253,6 +253,24 @@ } } + val receiverIsSpecificType = recPosIdx >= 0 && combination[recPosIdx] != null && + (combination[recPosIdx]!!.startsWith("opensavvy") || combination[recPosIdx]!!.startsWith("kotlin.reflect.KProperty1")) + val hasResultAlternative = !receiverIsSpecificType && valuePositions.zip(combination).any { (_, t) -> + t != null && !t.startsWith("opensavvy") && !t.startsWith("kotlin.reflect.KProperty1") + } + // True when ANY position has a raw-type substitution (including when the receiver + // is Field<>/KProperty1<>). Used to decide whether 'final inline' and 'reified' + // are needed — these are required whenever of(rawParam) is called in the body. + val hasAnyRawTypeSubstitution = valuePositions.zip(combination).any { (_, t) -> + t != null && !t.startsWith("opensavvy") && !t.startsWith("kotlin.reflect.KProperty1") + } + val rawResultTypeNames = if (hasAnyRawTypeSubstitution) { + valuePositions.zip(combination) + .filter { (_, t) -> t != null && !t.startsWith("opensavvy") && !t.startsWith("kotlin.reflect.KProperty1") } + .map { (pos, _) -> pos.resultType } + .distinct() + } else emptyList() + // Build the delegation call val receiverReplaced = hasValueReceiver && combination[recPosIdx] != null val receiverPrefix = when { @@ -289,6 +307,34 @@ newSignature + " =\n\t\t$delegationCall" } + // For raw-type (literal value) overloads, mark as 'final inline' and add + // 'reified' to each substituted type param so the delegated of() call can + // capture the type at compile time. Skip when the function has lambda + // parameters: inline lambdas can't be passed to non-inline functions. + // Search the raw parameter-list source so ANTLR misparses of intersection + // types (e.g. T & Any inside a receiver lambda) don't silently miss a '->'. + val hasLambdaParams = run { + val paramListCtx = ctx.functionValueParameters() + paramListCtx != null && + source.substring(paramListCtx.start.startIndex, paramListCtx.stop.stopIndex + 1).contains("->") + } + var processedFuncText = newFuncText + // Only add 'final inline' + 'reified' when at least one raw result-type name + // is a non-parameterized type. Parameterized types like Collection can + // never be added as type params by addReifiedToTypeParam — 'final inline' + // without any reification adds noise (WRONG_MODIFIER_CONTAINING_DECLARATION) + // with zero benefit. + val anyWillBeReified = rawResultTypeNames.any { !it.contains('<') } + if (hasAnyRawTypeSubstitution && !hasLambdaParams && anyWillBeReified) { + val funIdx = processedFuncText.indexOf("fun ") + if (funIdx >= 0 && !processedFuncText.take(funIdx).contains("inline ")) { + processedFuncText = processedFuncText.substring(0, funIdx) + "final inline " + processedFuncText.substring(funIdx) + } + for (name in rawResultTypeNames) { + processedFuncText = addReifiedToTypeParam(processedFuncText, name) + } + } + // Build @JvmName suffix — added when field/kprop/result types are involved // to avoid JVM signature clashes from erasure val receiverSuffix = if (hasValueReceiver) { @@ -320,30 +366,35 @@ // beat Field.ne(Result) within the aggregation context. Adding the annotation // would cause an outer FilterQuery.ne(Field, V) to win over the aggregation // overload despite the aggregation context being the closer implicit receiver. - val receiverIsSpecificType = recPosIdx >= 0 && combination[recPosIdx] != null && - (combination[recPosIdx]!!.startsWith("opensavvy") || combination[recPosIdx]!!.startsWith("kotlin.reflect.KProperty1")) - val hasResultAlternative = !receiverIsSpecificType && valuePositions.zip(combination).any { (_, t) -> - t != null && !t.startsWith("opensavvy") && !t.startsWith("kotlin.reflect.KProperty1") - } // Merge INAPPLICABLE_JVM_NAME into the existing @Suppress rather than // adding a second (non-repeatable) @Suppress annotation. val afterJvmName = if (needsJvmName) { - if (newFuncText.contains("@Suppress(\"")) { - newFuncText.replaceFirst("@Suppress(\"", "@Suppress(\"INAPPLICABLE_JVM_NAME\", \"") + if (processedFuncText.contains("@Suppress(\"")) { + processedFuncText.replaceFirst("@Suppress(\"", "@Suppress(\"INAPPLICABLE_JVM_NAME\", \"") } else { - "@Suppress(\"INAPPLICABLE_JVM_NAME\")\n\t" + newFuncText + "@Suppress(\"INAPPLICABLE_JVM_NAME\")\n\t" + processedFuncText } - } else newFuncText + } else processedFuncText // @kotlin.internal.LowPriorityInOverloadResolution is itself an internal API, // so INVISIBLE_REFERENCE must be suppressed wherever it appears. - val annotatedFuncText = if (hasResultAlternative && !afterJvmName.contains("INVISIBLE_REFERENCE")) { + val afterInvisibleRef = if (hasResultAlternative && !afterJvmName.contains("INVISIBLE_REFERENCE")) { if (afterJvmName.contains("@Suppress(\"")) { afterJvmName.replaceFirst("@Suppress(\"", "@Suppress(\"INVISIBLE_REFERENCE\", \"") } else { "@Suppress(\"INVISIBLE_REFERENCE\")\n\t" + afterJvmName } } else afterJvmName + // final inline in interface bodies requires suppressing WRONG_MODIFIER_CONTAINING_DECLARATION. + val annotatedFuncText = if (hasAnyRawTypeSubstitution && !hasLambdaParams && anyWillBeReified && !afterInvisibleRef.contains("WRONG_MODIFIER_CONTAINING_DECLARATION")) { + if (afterInvisibleRef.contains("@Suppress(\"")) { + val suppressIdx = afterInvisibleRef.indexOf("@Suppress(\"") + val closeParenIdx = afterInvisibleRef.indexOf(")", suppressIdx) + afterInvisibleRef.substring(0, closeParenIdx) + ", \"WRONG_MODIFIER_CONTAINING_DECLARATION\"" + afterInvisibleRef.substring(closeParenIdx) + } else { + "@Suppress(\"WRONG_MODIFIER_CONTAINING_DECLARATION\")\n\t" + afterInvisibleRef + } + } else afterInvisibleRef val jvmNameAnnotation = if (needsJvmName) "@JvmName(\"$vFuncName$receiverSuffix$paramSuffix\")\n\t" else "" val lowPriorityAnnotation = if (hasResultAlternative) "@kotlin.internal.LowPriorityInOverloadResolution\n\t" else "" @@ -369,10 +420,20 @@ kpropReceiverText + newSignature.substring(recIdxInNewSig + recText.length) val kpropDelegationCall = "this.field.$vFuncName($delegationArgs)" - val kpropNewFuncText = if (bodyStartInFunc >= 0) { + var kpropNewFuncText = if (bodyStartInFunc >= 0) { kpropNewSignature + "=\n\t\t$kpropDelegationCall" } else { kpropNewSignature + " =\n\t\t$kpropDelegationCall" + } + // Apply final inline + reified to KProperty1 variants that delegate via of(). + if (hasAnyRawTypeSubstitution && !hasLambdaParams) { + val funIdx = kpropNewFuncText.indexOf("fun ") + if (funIdx >= 0 && !kpropNewFuncText.take(funIdx).contains("inline ")) { + kpropNewFuncText = kpropNewFuncText.substring(0, funIdx) + "final inline " + kpropNewFuncText.substring(funIdx) + } + for (name in rawResultTypeNames) { + kpropNewFuncText = addReifiedToTypeParam(kpropNewFuncText, name) + } } // KProperty1 receiver is specific — omit @LowPriorityInOverloadResolution // (same exception as when a Value<> receiver is replaced by Field<>/KProperty1<>). @@ -380,15 +441,24 @@ it != null && (it.startsWith("opensavvy") || it.startsWith("kotlin.reflect.KProperty1")) } - val kpropAfterJvmName = if (kpropNeedsJvmName) { + var kpropFinalText = if (kpropNeedsJvmName) { if (kpropNewFuncText.contains("@Suppress(\"")) { kpropNewFuncText.replaceFirst("@Suppress(\"", "@Suppress(\"INAPPLICABLE_JVM_NAME\", \"") } else { "@Suppress(\"INAPPLICABLE_JVM_NAME\")\n\t" + kpropNewFuncText } } else kpropNewFuncText + if (hasAnyRawTypeSubstitution && !hasLambdaParams && !kpropFinalText.contains("WRONG_MODIFIER_CONTAINING_DECLARATION")) { + kpropFinalText = if (kpropFinalText.contains("@Suppress(\"")) { + val suppressIdx = kpropFinalText.indexOf("@Suppress(\"") + val closeParenIdx = kpropFinalText.indexOf(")", suppressIdx) + kpropFinalText.substring(0, closeParenIdx) + ", \"WRONG_MODIFIER_CONTAINING_DECLARATION\"" + kpropFinalText.substring(closeParenIdx) + } else { + "@Suppress(\"WRONG_MODIFIER_CONTAINING_DECLARATION\")\n\t" + kpropFinalText + } + } val kpropJvmNameAnnotation = if (kpropNeedsJvmName) "@JvmName(\"${vFuncName}PropertyReceiver${paramSuffix}\")\n\t" else "" - valueOverloadBuilder.append("\n\n").append(docPart).append("\t").append(kpropJvmNameAnnotation).append(kpropAfterJvmName) + valueOverloadBuilder.append("\n\n").append(docPart).append("\t").append(kpropJvmNameAnnotation).append(kpropFinalText) } } } @@ -444,15 +514,21 @@ val paramCount = ctx.functionValueParameters()?.functionValueParameter()?.size ?: 0 if (Pair(funcName, paramCount) in existingKPropFunctions) return + val paramCtxList = ctx.functionValueParameters()?.functionValueParameter() ?: emptyList() + // KType methods are internal delegation targets called by inline reified overloads; skip KProperty1 generation + if (paramCtxList.any { fp -> + val paramType = fp.parameter()?.type() ?: return@any false + source.substring(paramType.start.startIndex, paramType.stop.stopIndex + 1) == "KType" + }) return + val kpropReceiver = receiverText.replaceFirst("Field<", "kotlin.reflect.KProperty1<") - val paramCallParts = ctx.functionValueParameters() - ?.functionValueParameter() - ?.mapNotNull { fp -> + val paramCallParts = paramCtxList + .mapNotNull { fp -> val name = fp.parameter()?.simpleIdentifier()?.text ?: return@mapNotNull null val isVararg = fp.modifierList()?.text?.contains("vararg") == true if (isVararg) "*$name" else name - } ?: emptyList() + } val paramCall = paramCallParts.joinToString(", ") val funcStart = ctx.start.startIndex @@ -485,7 +561,6 @@ insertionBuilder.append("\n\n").append(docPart).append("\t").append(kpropFuncText) // For each parameter whose type starts with Field<, also generate overloads with KProperty1 for that param - val paramCtxList = ctx.functionValueParameters()?.functionValueParameter() ?: emptyList() for (fieldParamCtx in paramCtxList) { val paramType = fieldParamCtx.parameter()?.type() ?: continue val paramTypeText = source.substring(paramType.start.startIndex, paramType.stop.stopIndex + 1) @@ -804,5 +879,45 @@ return "" } return "" + } + + /** + * Inserts `reified` before [typeName] in the type parameter block of [funcText]. + * Scoped to the `<…>` block immediately following `fun ` so it never touches + * return types or parameter types that coincidentally contain the same name. + */ + private fun addReifiedToTypeParam(funcText: String, typeName: String): String { + if (funcText.contains("reified $typeName")) return funcText + val funIdx = funcText.indexOf("fun ") + if (funIdx < 0) return funcText + var pos = funIdx + 4 + while (pos < funcText.length && funcText[pos].isWhitespace()) pos++ + if (pos >= funcText.length || funcText[pos] != '<') return funcText + val typeParamStart = pos + var depth = 0 + var typeParamEnd = -1 + for (i in typeParamStart until funcText.length) { + when (funcText[i]) { + '<' -> depth++ + '>' -> { + depth-- + if (depth == 0) { + typeParamEnd = i + break + } + } + } + } + if (typeParamEnd < 0) return funcText + val block = funcText.substring(typeParamStart, typeParamEnd + 1) + val modified = block + .replace(" $typeName :", " reified $typeName :") + .replace(" $typeName>", " reified $typeName>") + .replace(" $typeName,", " reified $typeName,") + .replace("<$typeName>", "") + .replace("<$typeName :", " Unit.INSTANCE, filters -> { - filters.eq(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::name), "foo"); + filters.eq(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::name), "foo", KtMongo.typeOf("foo")); filters.and((it) -> { - it.gt(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::age), 5); - it.eq(JavaField.of(Utilisateur::name), "bar"); + it.gt(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::age), 5, KtMongo.typeOf(5)); + it.eq(JavaField.of(Utilisateur::name), "bar", KtMongo.typeOf("bar")); return Unit.INSTANCE; }); @@ -71,11 +71,11 @@ // Using the Java helpers collection.find(options(), filter(filter -> { - filter.eq(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::name), "Bob"); + filter.eq(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::name), "Bob", KtMongo.typeOf("Bob")); filter.and(filter(and -> { - and.gt(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::age), 5); - and.eq(JavaField.of(Utilisateur::name), "bar"); + and.gt(JavaField.of(Utilisateur::enfant).child(Utilisateur.Enfant::age), 5, KtMongo.typeOf(5)); + and.eq(JavaField.of(Utilisateur::name), "bar", KtMongo.typeOf("bar")); })); })).toList();