A wrapper around Either[SchemaError, Chunk[DynamicValue]] that provides fluent chaining for DynamicValue navigation and querying operations.
DynamicValueSelection enables a fluent API style for navigating through DynamicValue structures:
val dv = DynamicValue.Record(
"users" -> DynamicValue.Sequence(
DynamicValue.Record("name" -> DynamicValue.string("Alice"))
)
)
val names: DynamicValueSelection =
dv.get("users").sequences.apply(0).get("name").primitives
The selection can contain zero, one, or multiple DynamicValue values, supporting both single-value navigation and multi-value queries.
Attributes
- Companion
- object
- Source
- DynamicValueSelection.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Combines two selections, concatenating their values.
Returns all selected values condensed into a single DynamicValue. If there are multiple values, wraps them in a Sequence. Fails if the selection is empty or an error.
Returns all selected values condensed into a single DynamicValue. If there are multiple values, wraps them in a Sequence. Fails if the selection is empty or an error.
Attributes
- Source
- DynamicValueSelection.scala
Returns any single value from the selection. Fails if the selection is empty or an error.
Returns any single value from the selection. Fails if the selection is empty or an error.
Attributes
- Source
- DynamicValueSelection.scala
Unsafe version of any - throws SchemaError on error.
Navigates to an index in each sequence.
Navigates to a field in each record (alias for get).
Navigates using a DynamicOptic path (alias for get).
Narrows the single selected value to the specified DynamicValue type. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Narrows the single selected value to the specified DynamicValue type. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Attributes
- Source
- DynamicValueSelection.scala
Narrows all selected values to the specified DynamicValue type. Values not matching the type are silently dropped.
Narrows all selected values to the specified DynamicValue type. Values not matching the type are silently dropped.
Attributes
- Source
- DynamicValueSelection.scala
Extracts a primitive value of type A from the single selected value. Fails if there are 0 or more than 1 values, or if the value isn't the expected primitive.
Extracts a primitive value of type A from the single selected value. Fails if there are 0 or more than 1 values, or if the value isn't the expected primitive.
Attributes
- Source
- DynamicValueSelection.scala
Extracts primitive values of type A from all selected values. Values not matching the type are silently dropped.
Extracts primitive values of type A from all selected values. Values not matching the type are silently dropped.
Attributes
- Source
- DynamicValueSelection.scala
Collects values for which the partial function is defined.
Collects values for which the partial function is defined.
Attributes
- Source
- DynamicValueSelection.scala
Deletes the value at the given path in each selected value.
Deletes the value at the given path in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Deletes the value at the given path. Fails if the path doesn't exist.
Deletes the value at the given path. Fails if the path doesn't exist.
Attributes
- Source
- DynamicValueSelection.scala
Recursively removes empty Records, Sequences, and Maps in each selected value.
Recursively removes empty Records, Sequences, and Maps in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Recursively removes all Null values from containers in each selected value.
Recursively removes all Null values from containers in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Recursively removes all Primitive(Unit) values from containers in each selected value.
Recursively removes all Primitive(Unit) values from containers in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Returns the error if this is a failure, otherwise None.
Returns the error if this is a failure, otherwise None.
Attributes
- Source
- DynamicValueSelection.scala
Filters by DynamicValueType.
Filters selected values based on a predicate.
FlatMaps a function over all selected values, combining results.
FlatMaps a function over all selected values, combining results.
Attributes
- Source
- DynamicValueSelection.scala
Navigates to a field in each record.
Navigates to a map entry by key.
Navigates using a DynamicOptic path.
Navigates into a variant case.
Returns this selection's values, or the default on failure.
Returns this selection's values, or the default on failure.
Attributes
- Source
- DynamicValueSelection.scala
Inserts a value at the given path in each selected value.
Inserts a value at the given path in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Inserts a value at the given path. Fails if the path already exists or the parent doesn't exist.
Inserts a value at the given path. Fails if the path already exists or the parent doesn't exist.
Attributes
- Source
- DynamicValueSelection.scala
Returns true if this selection is empty (no values or error).
Returns true if this selection is empty (no values or error).
Attributes
- Source
- DynamicValueSelection.scala
Returns true if the selection is a failure.
Returns true if the selection is successful (contains values).
Returns true if the selection is successful (contains values).
Attributes
- Source
- DynamicValueSelection.scala
Maps a function over all selected values.
Keeps only map values.
Merges each value in this selection with each value in that selection. Uses cartesian product semantics: if this has N values and that has M values, the result has N × M values.
Merges each value in this selection with each value in that selection. Uses cartesian product semantics: if this has N values and that has M values, the result has N × M values.
Attributes
- Source
- DynamicValueSelection.scala
Modifies the value at the given path in each selected value.
Modifies the value at the given path in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Modifies values at the given path using a partial function. Fails if the path doesn't exist or the partial function is not defined.
Modifies values at the given path using a partial function. Fails if the path doesn't exist or the partial function is not defined.
Attributes
- Source
- DynamicValueSelection.scala
Returns true if this selection contains at least one value.
Returns true if this selection contains at least one value.
Attributes
- Source
- DynamicValueSelection.scala
Applies sortFields, sortMapKeys, dropNulls, dropUnits, and dropEmpty to each selected value.
Applies sortFields, sortMapKeys, dropNulls, dropUnits, and dropEmpty to each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Keeps only null values.
Returns the single selected value, or fails if there are 0 or more than 1 values.
Returns the single selected value, or fails if there are 0 or more than 1 values.
Attributes
- Source
- DynamicValueSelection.scala
Unsafe version of one - throws SchemaError on error.
Returns this selection if successful, otherwise the alternative.
Returns this selection if successful, otherwise the alternative.
Attributes
- Source
- DynamicValueSelection.scala
Keeps only primitive values.
Projects each selected value to only include the specified paths.
Projects each selected value to only include the specified paths.
Attributes
- Source
- DynamicValueSelection.scala
Removes values matching the predicate from each selected value.
Removes values matching the predicate from each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Removes values matching both path and value predicates from each selected value.
Removes values matching both path and value predicates from each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Removes values at paths matching the predicate from each selected value.
Removes values at paths matching the predicate from each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Recursively searches each DynamicValue in the selection, collecting all values for which the predicate returns true.
Recursively searches each DynamicValue in the selection, collecting all values for which the predicate returns true.
Attributes
- Source
- DynamicValueSelection.scala
Recursively searches each DynamicValue in the selection, collecting all values for which the predicate on both path and value returns true.
Recursively searches each DynamicValue in the selection, collecting all values for which the predicate on both path and value returns true.
Attributes
- Source
- DynamicValueSelection.scala
Recursively searches each DynamicValue in the selection, collecting all values at paths for which the predicate returns true.
Recursively searches each DynamicValue in the selection, collecting all values at paths for which the predicate returns true.
Attributes
- Source
- DynamicValueSelection.scala
Keeps only record values.
Retains only values matching the predicate in each selected value.
Retains only values matching the predicate in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Retains only values matching both path and value predicates in each selected value.
Retains only values matching both path and value predicates in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Retains only values at paths matching the predicate in each selected value.
Retains only values at paths matching the predicate in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Keeps only sequence values.
Sets a value at the given path in each selected value.
Sets a value at the given path in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Sets a value at the given path. Fails if the path doesn't exist.
Sets a value at the given path. Fails if the path doesn't exist.
Attributes
- Source
- DynamicValueSelection.scala
Returns the number of selected values (0 on error).
Recursively sorts all record fields alphabetically in each selected value.
Recursively sorts all record fields alphabetically in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Recursively sorts all map entries by key in each selected value.
Recursively sorts all map entries by key in each selected value.
Attributes
- Source
- DynamicValueSelection.scala
Returns the selected values as a Chunk, or an empty Chunk on failure.
Returns the selected values as a Chunk, or an empty Chunk on failure.
Attributes
- Source
- DynamicValueSelection.scala
Returns all selected values as a DynamicValue.Sequence.
Returns all selected values as a DynamicValue.Sequence.
Attributes
- Source
- DynamicValueSelection.scala
Transforms each selected value top-down using the given function.
Transforms each selected value top-down using the given function.
Attributes
- Source
- DynamicValueSelection.scala
Transforms all record field names in each selected value using the given function.
Transforms all record field names in each selected value using the given function.
Attributes
- Source
- DynamicValueSelection.scala
Transforms all map keys in each selected value using the given function.
Transforms all map keys in each selected value using the given function.
Attributes
- Source
- DynamicValueSelection.scala
Transforms each selected value bottom-up using the given function.
Transforms each selected value bottom-up using the given function.
Attributes
- Source
- DynamicValueSelection.scala
Extracts the underlying Scala value from the single selected DynamicValue. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Extracts the underlying Scala value from the single selected DynamicValue. Fails if there are 0 or more than 1 values, or if the value doesn't match.
Attributes
- Source
- DynamicValueSelection.scala
Extracts the underlying Scala values from all selected DynamicValues. Values not matching the type are silently dropped.
Extracts the underlying Scala values from all selected DynamicValues. Values not matching the type are silently dropped.
Attributes
- Source
- DynamicValueSelection.scala
Returns the selected values if successful, otherwise None.
Returns the selected values if successful, otherwise None.
Attributes
- Source
- DynamicValueSelection.scala
Keeps only variant values.
Inherited methods
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
- Source
- Product.scala
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
- Source
- Product.scala