Dynamic selectors allow you to select items from lists or maps when you don't know the key or index. You can think of this as searching the current node.


You can use a selector as the key to create more complex conditions.



The key defines which property/selector we should use to extract a value.


The value is the expected value for the check to pass.

Note that dasel will stringy values prior to checking if they match.


Dasel supports the following comparison operators:

  • >=

  • >

  • =

  • <

  • <=

Prior to v1.14.0 dasel only supports to = operator.

Multiple conditions

You can use multiple dynamic selectors within the same part to perform AND logic.


Non-object values

You can evaluate and check against non-object values by defining the key as either value or .. Doing so will tell dasel extract the value of the current node and compare that against <value>.

Selectors as a key

When performing dynamic checks dasel internally creates a new root node at the current position and queries data from there.

This means that you can use fully formed selectors as a key to create more advanced logic.


The above selector in plain English may read as...

Give me the first name of the user who's primary address is at number 123.

The resolution of that query looks something like this:



- name: red
rgb: ff0000
- name: green
rgb: 00ff00
- name: blue
rgb: 0000ff
"users": [
"name": {
"first": "Tom",
"last": "Wright"
"addresses": [
"primary": true,
"number": 123
"primary": false,
"number": 456

Single condition

dasel select -f simple_input.yaml '.colourCodes.(name=red).rgb'

Multiple conditions

dasel select -f simple_input.yaml '.colourCodes.(name=red)(rgb=ff0000).rgb'

Selector as a key

dasel -f advanced_input.json '.users.(.addresses.(.primary=true).number=123).name.first'