get

open operator fun get(field: String): BsonPath(source)

Points to a field in a Bson document.

Example

BsonPath["foo"]         // $.foo
BsonPath["foo"]["bar"] // $.foo.bar

open operator fun get(index: Int): BsonPath(source)

Points to the element at index in a BsonArray.

BSON indices start at 0.

Example

BsonPath[0]         // $[0]
BsonPath["foo"][1] // $.foo[1]