MongoDB request DSL • opensavvy.ktmongo.dsl.path
Package-level declarations¶
Utilities for referencing variables and classes.
User::_id // _id
User::profile / Profile::name // profile.name
User::friends[1] / Friend::name // friends.$1.name
This package contains a low-level type-unsafe implementation
of arbitrary document paths, and a high-level type-safe wrapper
that provides the above utility functions.
Note that some functions are only provided when the FieldDsl
is into scope (which should be done automatically by most operators). This means that you should rarely need to import anything for these functions to be available.
Operators¶
Types¶
Field
¶
High-level, typesafe pointer to a specific field in a document.
FieldDsl
¶
interface FieldDsl
DSL to refer to fields
, usually automatically added into scope by operators.
Path
¶
data class Path(val segment: PathSegment, val parent: Path?)
Low-level, type-unsafe pointer to a specific field in a document.
PathSegment
¶
sealed class PathSegment
Single segment in a Path
.
Functions¶
div
¶
operator fun Path.div(segment: PathSegment): Path
get
¶
Refers to a specific item in an array, by its index.
Refers to a specific item in a map, by its name.
Path
¶
Creates a root path from the provided root
field name.