githubEdit

MapOf

Expects 2 or more arguments.

Expects arguments to be given in pairs, where the first argument is the property name, and the second argument is a selector that will be used to resolve the property value.

Examples

Filtering values into lists

$ echo '[1,2,3,4,5]' | 
  dasel -r json 'mapOf(lessThan,all().filter(lessThan(.,3)).merge(),moreThan,all().filter(moreThan(.,3)).merge())'
{
  "lessThan": [
    1,
    2
  ],
  "moreThan": [
    4,
    5
  ]
}

Restructuring/picking specific fields

Exporting specific fields to csv

Last updated