📄
Dasel
v1
v1
  • Introduction
  • Installation
    • Update
  • Use as a go package
  • Github
  • Playground
  • Usage
    • Select
    • Put
    • Put object
    • Put document
    • Delete
    • Validate
    • Flags
      • Escape HTML
      • Format
      • Multiple
      • Null
      • Merge Input Documents
    • Supported file types
  • Selectors
    • Introduction
    • Property
    • Keys and indexes
    • Index
    • Next Available Index
    • All indexes
    • Dynamic
    • Search
    • Search Optional
    • Length
    • Type
  • Notes
    • File formatting and ordering
    • Memory usage
    • Converting between formats
  • Examples
    • JQ to Dasel
    • YQ to Dasel
    • XML
    • Filter JSON API results
Powered by GitBook
On this page
  • Description
  • Usage
  • Return types
  • Example
Edit on GitHub
  1. Selectors

Type

Description

The type selector can be used to return the type of the current node.

Usage

.[@]

Return types

The type selector can return the following types:

  • array

  • map

  • string

  • int

  • float

  • bool

Example

$ echo '{"numbers": [5, 2, 3, 1, 4]}' | dasel -r json '.[@]'
"map"
$ echo '{"numbers": [5, 2, 3, 1, 4]}' | dasel -r json '.numbers.[@]'
"array"
$ echo '{"numbers": [5, 2, 3, 1, 4]}' | dasel -r json '.numbers.[0].[@]'
"float"
PreviousLengthNextFile formatting and ordering

Last updated 2 years ago