Skip to content

MongoDB request DSLopensavvy.ktmongo.dsl.pathPath

Path

data class Path(val segment: PathSegment, val parent: Path?)

Low-level, type-unsafe pointer to a specific field in a document.

A path is a string pointer that identifies which field(s) are impacted by an operator.

For example, the following are valid paths:

  • "foo": targets the field "foo",

  • "foo.bar": targets the field "bar" which is part of the object "foo",

  • "arr.$5.bar": targets the field "bar" which is part of the item with index 5 in the array "arr".

This structure is a singly-linked list representing the entire path. Each segment is represented by PathSegment.

Constructors

Path

constructor(segment: PathSegment, parent: Path?)

Types

Companion

object Companion

Properties

parent

val parent: Path?

segment

Functions

asSequence

div

operator fun Path.div(path: Path): Path

Returns a new Path instance that is the concatenation of the current path and a child path.

operator fun Path.div(segment: PathSegment): Path

Returns a new Path instance that is the concatenation of the current path and a segment.

toString

open override fun toString():