📄
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
  • Example
Edit on GitHub
  1. Selectors

Next Available Index

PreviousIndexNextAll indexes

Last updated 2 years ago

Description

The next available index selector allows you to target the next available index of an array.

You can think of this as appending to a list.

Usage

This is only available in commands.

.[]

Example

$ echo '{"x": [1, 2]}' | dasel put int -p json '.x.[]' 3
{
  "x": [
    1,
    2,
    3
  ]
}
put