KPropertyPath

@Sealed
open class KPropertyPath<T, R>(previous: KPropertyPath<T, *>?, property: KProperty1<*, R?>) : KProperty1<T, R>

A property path, operations on which take one receiver as a parameter.

Parameters

T

the type of the receiver which should be used to obtain the value of the property.

R

the type of the property.

Inheritors

Constructors

Link copied to clipboard
constructor(previous: KPropertyPath<T, *>?, property: KProperty1<*, R?>)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
@JvmName(name = "addToSetExt")
infix fun <T> KProperty<Iterable<T>?>.addToSet(value: T): Bson

Creates an update that adds the given value to the array value of the property, unless the value is already present, in which case it does nothing

Link copied to clipboard
@JvmName(name = "allvargsExt")
fun <T> KProperty<Iterable<T>?>.all(vararg values: T): Bson
@JvmName(name = "allExt")
infix fun <T> KProperty<Iterable<T>?>.all(values: Iterable<T>): Bson

Creates a filter that matches all documents where the value of a property is an array that contains all the specified values.

Link copied to clipboard
@JvmName(name = "bitsAllClearExt")
infix fun <T> KProperty<T?>.bitsAllClear(bitmask: Long): Bson

Creates a filter that matches all documents where all of the bit positions are clear in the property.

Link copied to clipboard
@JvmName(name = "bitsAllSetExt")
infix fun <T> KProperty<T?>.bitsAllSet(bitmask: Long): Bson

Creates a filter that matches all documents where all of the bit positions are set in the property.

Link copied to clipboard
@JvmName(name = "bitsAnyClearExt")
infix fun <T> KProperty<T?>.bitsAnyClear(bitmask: Long): Bson

Creates a filter that matches all documents where any of the bit positions are clear in the property.

Link copied to clipboard
@JvmName(name = "bitsAnySetExt")
infix fun <T> KProperty<T?>.bitsAnySet(bitmask: Long): Bson

Creates a filter that matches all documents where any of the bit positions are set in the property.

Link copied to clipboard
@JvmName(name = "bitwiseAndExt")
infix fun <T : Number?> KProperty<T>.bitwiseAnd(value: Int): Bson

Creates an update that performs a bitwise and between the given integer value and the integral value of the property.

@JvmName(name = "bitwiseAndExt")
infix fun <T : Number?> KProperty<T>.bitwiseAnd(value: Long): Bson

Creates an update that performs a bitwise and between the given long value and the integral value of the property.

Link copied to clipboard
@JvmName(name = "bitwiseOrExt")
infix fun <T : Number?> KProperty<T>.bitwiseOr(value: Int): Bson

Creates an update that performs a bitwise or between the given integer value and the integral value of the property.

@JvmName(name = "bitwiseOrExt")
infix fun <T : Number?> KProperty<T>.bitwiseOr(value: Long): Bson

Creates an update that performs a bitwise or between the given long value and the integral value of the property.

Link copied to clipboard
@JvmName(name = "bitwiseXorExt")
infix fun <T : Number?> KProperty<T>.bitwiseXor(value: Int): Bson

Creates an update that performs a bitwise xor between the given integer value and the integral value of the property.

@JvmName(name = "addToSetExt")
infix fun <T : Number?> KProperty<T>.bitwiseXor(value: Long): Bson

Creates an update that performs a bitwise xor between the given long value and the integral value of the property.

Link copied to clipboard
open override fun call(vararg args: Any?): R
Link copied to clipboard
open override fun callBy(args: Map<KParameter, Any?>): R
Link copied to clipboard
@JvmName(name = "computedFromExt")
infix fun <T> KProperty<T>.computed(expression: Any): Bson

Creates a projection of a property whose value is computed from the given expression. Projection with an expression can be used in the following contexts:

Link copied to clipboard
@JvmName(name = "computedSearchMetaExt")
fun <T> KProperty<T>.computedSearchMeta(): Bson

Creates a projection of a property whose value is equal to the {@code $$SEARCH_META} variable. for use with {@link Aggregates#search(SearchOperator, SearchOptions)} / {@link Aggregates#search(SearchCollector, SearchOptions)}. Calling this method is equivalent to calling {@link #computed(String, Object)} with {@code "$$SEARCH_META"} as the second argument.

Link copied to clipboard
operator fun <T0, T1, T2> KProperty1<T0, T1?>.div(p2: KProperty1<T1, T2?>): KProperty1<T0, T2?>

Returns a composed property. For example Friend::address / Address::postalCode = "address.postalCode".

@JvmName(name = "divCol")
operator fun <T0, T1, T2> KProperty1<T0, Iterable<T1>?>.div(p2: KProperty1<out T1, T2?>): KProperty1<T0, T2?>

Returns a collection composed property. For example Friend::addresses / Address::postalCode = "addresses.postalCode".

@JvmName(name = "divMap")
operator fun <T0, K, T1, T2> KProperty1<T0, Map<out K, T1>?>.div(p2: KProperty1<out T1, T2?>): KProperty1<T0, T2?>

Returns a map composed property. For example Friend::addresses / Address::postalCode = "addresses.postalCode".

Link copied to clipboard
@JvmName(name = "elemMatchExt")
infix fun <T> KProperty<Iterable<T>?>.elemMatch(filter: Bson): Bson

Creates a filter that matches all documents containing a property that is an array where at least one member of the array matches the given filter.

@JvmName(name = "elemMatchProjExt")
infix fun <T> KProperty<T>.elemMatch(filter: Bson): Bson

Creates a projection that includes for the given property only the first element of the array value of that field that matches the given query filter.

Link copied to clipboard
@JvmName(name = "eqExt")
infix fun <T> KProperty<T?>.eq(value: T?): Bson

Creates a filter that matches all documents where the value of the property equals the specified value. Note that this doesn't actually generate an $eq operator, as the query language doesn't require it.

Link copied to clipboard
@JvmName(name = "existsExt")
fun <T> KProperty<T?>.exists(): Bson

Creates a filter that matches all documents that contain the given property.

@JvmName(name = "existsExt")
infix fun <T> KProperty<T?>.exists(exists: Boolean): Bson

Creates a filter that matches all documents that either contain or do not contain the given property, depending on the value of the exists parameter.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "geoIntersectsExt")
infix fun <T> KProperty<T?>.geoIntersects(geometry: Geometry): Bson
@JvmName(name = "geoIntersectsExt")
infix fun <T> KProperty<T?>.geoIntersects(geometry: Bson): Bson

Creates a filter that matches all documents containing a property with geospatial data that intersects with the specified shape.

Link copied to clipboard
@JvmName(name = "geoWithinExt")
infix fun <T> KProperty<T?>.geoWithin(geometry: Geometry): Bson
@JvmName(name = "geoWithinExt")
infix fun <T> KProperty<T?>.geoWithin(geometry: Bson): Bson

Creates a filter that matches all documents containing a property with geospatial data that exists entirely within the specified shape.

Link copied to clipboard
@JvmName(name = "geoWithinBoxExt")
fun <T> KProperty<T?>.geoWithinBox(lowerLeftX: Double, lowerLeftY: Double, upperRightX: Double, upperRightY: Double): Bson

Creates a filter that matches all documents containing a property with grid coordinates data that exist entirely within the specified box.

Link copied to clipboard
@JvmName(name = "geoWithinCenterExt")
fun <T> KProperty<T?>.geoWithinCenter(x: Double, y: Double, radius: Double): Bson

Creates a filter that matches all documents containing a property with grid coordinates data that exist entirely within the specified circle.

Link copied to clipboard
@JvmName(name = "geoWithinCenterSphereExt")
fun <T> KProperty<T?>.geoWithinCenterSphere(x: Double, y: Double, radius: Double): Bson

Creates a filter that matches all documents containing a property with geospatial data (GeoJSON or legacy coordinate pairs) that exist entirely within the specified circle, using spherical geometry. If using longitude and latitude, specify longitude first.

Link copied to clipboard
@JvmName(name = "geoWithinPolygonExt")
infix fun <T> KProperty<T?>.geoWithinPolygon(points: List<List<Double>>): Bson

Creates a filter that matches all documents containing a property with grid coordinates data that exist entirely within the specified polygon.

Link copied to clipboard
open override fun get(receiver: T): R
Link copied to clipboard
open override fun getDelegate(receiver: T): Any?
Link copied to clipboard
@JvmName(name = "gtExt")
infix fun <T> KProperty<T>.gt(value: T): Bson

Creates a filter that matches all documents where the value of the given property is greater than the specified value.

Link copied to clipboard
@JvmName(name = "gteExt")
infix fun <T> KProperty<T>.gte(value: T): Bson

Creates a filter that matches all documents where the value of the given property is greater than or equal to the specified value.

Link copied to clipboard
@JvmName(name = "inExt")
infix fun <T> KProperty<T?>.in(values: Iterable<T?>): Bson
@JvmName(name = "inIterableExt")
infix fun <T> KProperty<Iterable<T>?>.in(values: Iterable<T?>): Bson

Creates a filter that matches all documents where the value of a property equals any value in the list of specified values.

Link copied to clipboard
@JvmName(name = "incExt")
infix fun <T : Number?> KProperty<T>.inc(number: Number): Bson

Creates an update that increments the value of the property by the given value.

Link copied to clipboard
open operator override fun invoke(p1: T): R
Link copied to clipboard
fun <K, T> KProperty1<out Any?, Map<out K, T>?>.keyProjection(key: K): KPropertyPath<Any?, T?>

Key projection of map. Sample: p.keyProjection(Locale.ENGLISH) / Gift::amount

Link copied to clipboard
@JvmName(name = "ltExt")
infix fun <T> KProperty<T?>.lt(value: T): Bson

Creates a filter that matches all documents where the value of the given property is less than the specified value.

Link copied to clipboard
@JvmName(name = "lteExt")
infix fun <T> KProperty<T?>.lte(value: T): Bson

Creates a filter that matches all documents where the value of the given property is less than or equal to the specified value.

Link copied to clipboard
@JvmName(name = "maxExt")
infix fun <T> KProperty<T>.max(value: T): Bson

Creates an update that sets the value of the property if the given value is greater than the current value of the property.

Link copied to clipboard
@JvmName(name = "metaExt")
infix fun <T> KProperty<T>.meta(metaFieldName: String): Bson

Creates a $meta projection for the given property

Link copied to clipboard

Creates a searchHighlights projection for the given property, for use with {@link Aggregates#search(SearchOperator, SearchOptions)} / {@link Aggregates#search(SearchCollector, SearchOptions)}. Calling this method is equivalent to calling {@link #meta(String, String)} with {@code "searchHighlights"} as the argument.

Link copied to clipboard
fun <T> KProperty<T>.metaSearchScore(): Bson

Creates a searchScore projection for the given property, for use with {@link Aggregates#search(SearchOperator, SearchOptions)} / {@link Aggregates#search(SearchCollector, SearchOptions)}. Calling this method is equivalent to calling {@link #meta(String, String)} with {@code "searchScore"} as the argument.

Link copied to clipboard
fun <T> KProperty<T>.metaTextScore(): Bson

Creates a textScore projection for the given property, for use with text queries. Calling this method is equivalent to calling {@link #meta(String)} with {@code "textScore"} as the argument.

Link copied to clipboard
@Beta(value = [Reason.SERVER])
fun <T> KProperty<T>.metaVectorSearchScore(): Bson

Creates a vectorSearchScore projection for the given property, for use with {@link Aggregates#vectorSearch(FieldSearchPath, Iterable, String, long, VectorSearchOptions)} . Calling this method is equivalent to calling {@link #meta(String, String)} with {@code "vectorSearchScore"} as the argument.

Link copied to clipboard
@JvmName(name = "minExt")
infix fun <T> KProperty<T>.min(value: T): Bson

Creates an update that sets the value of the property if the given value is less than the current value of the property.

Link copied to clipboard
@JvmName(name = "modExt")
fun <T> KProperty<T?>.mod(divisor: Long, remainder: Long): Bson

Creates a filter that matches all documents where the value of a property divided by a divisor has the specified remainder (i.e. perform a modulo operation to select documents).

Link copied to clipboard
@JvmName(name = "mulExt")
infix fun <T : Number?> KProperty<T>.mul(number: Number): Bson

Creates an update that multiplies the value of the property by the given number.

Link copied to clipboard
@JvmName(name = "neExt")
infix fun <T> KProperty<T?>.ne(value: T?): Bson

Creates a filter that matches all documents where the value of the property does not equal the specified value.

Link copied to clipboard
@JvmName(name = "nearExt")
fun <T> KProperty<T?>.near(geometry: Point, maxDistance: Double? = null, minDistance: Double? = null): Bson
@JvmName(name = "nearExt")
fun <T> KProperty<T?>.near(geometry: Bson, maxDistance: Double? = null, minDistance: Double? = null): Bson

Creates a filter that matches all documents containing a property with geospatial data that is near the specified GeoJSON point.

@JvmName(name = "nearExt")
fun <T> KProperty<T?>.near(x: Double, y: Double, maxDistance: Double? = null, minDistance: Double? = null): Bson

Creates a filter that matches all documents containing a property with geospatial data that is near the specified point.

Link copied to clipboard
@JvmName(name = "nearSphereExt")
fun <T> KProperty<T?>.nearSphere(geometry: Point, maxDistance: Double? = null, minDistance: Double? = null): Bson
@JvmName(name = "nearSphereExt")
fun <T> KProperty<T?>.nearSphere(geometry: Bson, maxDistance: Double? = null, minDistance: Double? = null): Bson

Creates a filter that matches all documents containing a property with geospatial data that is near the specified GeoJSON point using spherical geometry.

@JvmName(name = "nearSphereExt")
fun <T> KProperty<T?>.nearSphere(x: Double, y: Double, maxDistance: Double? = null, minDistance: Double? = null): Bson

Creates a filter that matches all documents containing a property with geospatial data that is near the specified point using spherical geometry.

Link copied to clipboard
@JvmName(name = "ninExt")
infix fun <T> KProperty<T?>.nin(values: Iterable<T?>): Bson
@JvmName(name = "ninIterableExt")
infix fun <T> KProperty<Iterable<T>?>.nin(values: Iterable<T?>): Bson

Creates a filter that matches all documents where the value of a property does not equal any of the specified values or does not exist.

Link copied to clipboard
fun <T> KProperty<T>.path(): String

Returns a mongo path of a property.

Link copied to clipboard
fun <T> KProperty1<out Any?, Iterable<T>?>.pos(position: Int): KPropertyPath<out Any?, T?>

In order to write array indexed expressions (like accesses.0.timestamp).

Link copied to clipboard

In order to write $p.p2

Link copied to clipboard
@JvmName(name = "pullExt")
infix fun <T> KProperty<Iterable<T?>?>.pull(value: T?): Bson

Creates an update that removes all instances of the given value from the array value of the property.

Link copied to clipboard
@JvmName(name = "pullAllExt")
infix fun <T> KProperty<Iterable<T>?>.pullAll(values: List<T?>?): Bson

Creates an update that removes all instances of the given values from the array value of the property.

Link copied to clipboard
@JvmName(name = "pullByFilterExt")
infix fun KProperty<*>.pullByFilter(filter: Bson): Bson

Creates an update that removes all instances of the given value from the array value of the property.

Link copied to clipboard
@JvmName(name = "regexExt")
infix fun KProperty<String?>.regex(pattern: Pattern): Bson
@JvmName(name = "regexExt")
infix fun KProperty<String?>.regex(pattern: String): Bson
@JvmName(name = "regexExt")
infix fun KProperty<String?>.regex(regex: Regex): Bson
@JvmName(name = "regexIterableExt")
infix fun KProperty<Iterable<String?>>.regex(pattern: Pattern): Bson
@JvmName(name = "regexIterableExt")
infix fun KProperty<Iterable<String?>>.regex(pattern: String): Bson
@JvmName(name = "regexIterableExt")
infix fun KProperty<Iterable<String?>>.regex(regex: Regex): Bson

Creates a filter that matches all documents where the value of the property matches the given regular expression pattern.

@JvmName(name = "regexExt")
fun KProperty<String?>.regex(pattern: String, options: String): Bson
@JvmName(name = "regexIterableExt")
fun KProperty<Iterable<String?>>.regex(regex: String, options: String): Bson

Creates a filter that matches all documents where the value of the option matches the given regular expression pattern with the given options applied.

Link copied to clipboard
operator fun <T0, T1, T2> KProperty1<T0, T1?>.rem(p2: KProperty1<out T1, T2?>): KProperty1<T0, T2?>

Returns a composed property without type checks. For example Friend::address % Address::postalCode = "address.postalCode".

Link copied to clipboard
@JvmName(name = "renameExt")
infix fun <T> KProperty<T?>.rename(newProperty: KProperty<T?>): Bson

Creates an update that renames a field.

Link copied to clipboard
@JvmName(name = "setExt")
infix fun <T> KProperty<T>.set(value: T?): Bson

Creates an update that sets the value of the property to the given value.

Link copied to clipboard
@JvmName(name = "setOnInsertExt")
infix fun <T> KProperty<T?>.setOnInsert(value: T?): Bson

Creates an update that sets the value of the property to the given value, but only if the update is an upsert that results in an insert of a document.

Link copied to clipboard
@JvmName(name = "sizeExt")
infix fun <T> KProperty<T?>.size(size: Int): Bson

Creates a filter that matches all documents where the value of a property is an array of the specified size.

Link copied to clipboard
infix fun <T> KProperty<T>.slice(limit: Int): Bson
fun <T> KProperty<T>.slice(skip: Int, limit: Int): Bson

Creates a projection to the given property of a slice of the array value of that field.

Link copied to clipboard
@JvmName(name = "typeExt")
infix fun <T> KProperty<T?>.type(type: BsonType): Bson

Creates a filter that matches all documents where the value of the property is of the specified BSON type.

Properties

Link copied to clipboard
Link copied to clipboard
open override val annotations: List<Annotation>
Link copied to clipboard

Returns a collection property.

Link copied to clipboard
val <T> KProperty<T>.elemMatch: Bson

Creates a projection that includes for the given property only the first element of an array that matches the query filter. This is referred to as the positional $ operator.

Link copied to clipboard
open override val getter: KProperty1.Getter<T, R>
Link copied to clipboard
open override val isAbstract: Boolean
Link copied to clipboard
open override val isConst: Boolean
Link copied to clipboard
open override val isFinal: Boolean
Link copied to clipboard
open override val isLateinit: Boolean
Link copied to clipboard
open override val isOpen: Boolean
Link copied to clipboard
open override val isSuspend: Boolean
Link copied to clipboard
val <K, T> KProperty1<out Any?, Map<out K, T>?>.mapProperty: KMapSimplePropertyPath<out Any?, K, T>

Returns a map property.

Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val parameters: List<KParameter>
Link copied to clipboard

The projection of the property. This is used in an aggregation pipeline to reference a property from a path.

Link copied to clipboard
open override val returnType: KType
Link copied to clipboard
open override val typeParameters: List<KTypeParameter>
Link copied to clipboard
open override val visibility: KVisibility?