# Merge

Merge expect 0 or more arguments.

## No arguments

When called with no arguments merge takes all of the output values from the previous function and adds them to a single list.

## 1 or more arguments

When called with 1 or more arguments, the arguments are executed as a subquery on each of the output values from the previous function.

All values returned from subqueries across all input values are added to a single list.

## Examples

### Merge arguments

```
$ echo '{
  "name": {
    "first":"Tom",
    "last":"Wright"
  },
  "firstNames": [
    "Jim",
    "Bob"
  ]
}' | dasel -r json 'merge(name.first,firstNames.all()).all()' 
[
  "Tom",
  "Jim",
  "Bob"
]
```

### Merge no arguments

```
$ echo '[
  {"name": {"first": "Tom"}},
  {"name": {"first": "Jim"}},
  {"name": {"first": "Frank"}}
]' | dasel -r json 'all().name.first.merge()' 
[
  "Tom",
  "Jim",
  "Frank"
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://daseldocs.tomwright.me/v2/functions/merge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
