MongoDB request DSL • opensavvy.ktmongo.dsl.path • selectFirst
selectFirst¶
inline fun <T> ERROR CLASS: Symbol not found for Bson.selectFirst(field: Field<*, T>): T
Finds the first value that matches field in a given Bson.
To learn more about the syntax, see BsonPath.
Example¶
will return the value of the field profile.name.
See also¶
-
BsonPath Learn more about BSON paths.
-
selectSelect multiple values with a BSON path. -
atSelect a single value using infix notation.
Throws¶
- NoSuchElementException
-
If no element is found matching the path.