Skip to content

Kotlin BSON • Multiplatform abstraction for different BSON implementationsopensavvy.ktmongo.bsonBsonPathPathOrSelector

PathOrSelector

Marker interface for types that implement both BsonPath and Selector.

These types are mainly found as return types in the BsonPath.Root object.

Properties

all

open val all: BsonPath

Points to all children of a document.

parent

abstract val parent: BsonPath?

The parent path of this path: the same path without the last segment.

Functions

any

open fun any(vararg selectors: BsonPath.Selector): BsonPath

Allows specifying multiple selectors.

findIn

@LowLevelApi
abstract fun findIn(reader: BsonValueReader): Sequence<BsonValueReader>

Applies the filters described by this path on the reader.

findInParent

@LowLevelApi
abstract fun findInParent(reader: BsonValueReader): Sequence<BsonValueReader>

Applies the filters described by this path on the reader.

get

open operator fun get(index: Int): BsonPath

Points to the element at index in a BsonArray.

open operator fun get(field: String): BsonPath

Points to a field in a Bson document.

reversed

open fun reversed(): BsonPath

Iterates a BsonArray in the reversed order, starting from the end.

sliced

open fun sliced(range: IntProgression): BsonPath

Points to the elements of a BsonArray at the indices selected by range.

open fun sliced(start: Int? = null, end: Int? = null, step: Int = 1): BsonPath

Points to the elements of a BsonArray at the indices selected by start and end, with an optional step.