Dasel
v2
v2
  • Introduction
  • GitHub
  • Supported file formats
  • Memory usage
  • Installation
  • Commands
    • Select
    • Put
    • Delete
  • Functions
    • Selector Overview
    • All
    • And
    • Append
    • Count
    • Equal
    • Filter
    • FilterOr
    • First
    • Index
    • Join
    • Key
    • Keys
    • Last
    • Len
    • LessThan
    • MapOf
    • Merge
    • MoreThan
    • Not
    • Or
    • OrDefault
    • Parent
    • Property
    • String
    • Null
    • This
    • Type
  • Examples
    • Using dasel as a go package
    • Basics
    • Change file format
    • Filtering objects based on present/missing key
Powered by GitBook
On this page
  • Usage
  • Examples
  • Property with optional field
  • Property using alias
Edit on GitHub
  1. Functions

Property

Accepts 1 or more arguments.

Returns the values found under the given keys.

If any argument ends with a ?, that lookup is considered optional and dasel will continue if that property is not found.

Usage

Because property is a commonly used function, it has an alias.

If no round brackets are detected in a selector part and no other function detects it as an alias, dasel assumes it is a property name.

Examples

Property with optional field

$ echo '{"x": 1, "y": 2, "z": 3}' | dasel -r json 'property(x,y,bad?)'
1
2

Property using alias

$ echo '{"x": 1, "y": 2, "z": 3}' | dasel -r json 'x'
1
PreviousParentNextString

Last updated 2 years ago