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.

Example

BsonPath[0]         // $[0]
BsonPath["foo"][1] // $.foo[1], the first element
BsonPath["foo"][-1] // $.foo[-1], the very least element