selectFirst
Finds the first value that matches field in a given BSON document.
To learn more about the syntax, see BsonPath.
Example
val document: Bson = …
document.selectFirst(User::profile / Profile::name)Content copied to clipboard
will return the value of the field profile.name.
See also
Learn more about BSON paths.
Select multiple values with a BSON path.
Select a single value using infix notation.
Throws
If no element is found matching the path.