Skip to content

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

Root

object Root : BsonPath

The root of a BsonPath expression.

All BSON paths start at the root. For example, BsonPath["foo"] refers to the field "foo".

For more information, see BsonPath.

Properties

all

open override val all: BsonPath.PathOrSelector

Points to all children of a document.

parent

open override val parent: Nothing?

Always returns null.

Functions

any

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

Allows specifying multiple selectors.

findIn

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

Applies the filters described by this path on the reader.

get

open operator override fun get(index: Int): BsonPath.PathOrSelector

Points to the element at index in a BsonArray.

open operator override fun get(field: String): BsonPath.PathOrSelector

Points to a field in a Bson document.

parse

fun parse(text: String): BsonPath

reversed

open override fun reversed(): BsonPath.PathOrSelector

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

sliced

open override fun sliced(range: IntProgression): BsonPath.PathOrSelector

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

open override fun sliced(start: Int?, end: Int?, step: Int): BsonPath.PathOrSelector

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

toString

open override fun toString(): String