# Default operation for Array Items
```yaml=
#@overlay/replace is default operation for arrays.
if there is an array in schema then i need to know overlays. each array item needs match annotation.
app_domains:
- foo.com
- blah.com
annotations: {} string->string
vs
app_domains:
- foo.com
- blah.com
annotations:
key: val
#@overlay/replace - action to mutate value of node that annotation is atteched to
key: val
#@overlay/match ...
---
foo: >>>> is an array
- blah
- bar
<<<<
#@overlay/match ...
---
foo:
- blah
#@overlay/insert (just on array item, not inside)
- bar
this:
#@overlay/match ...
---
foo:
- blah
- bar
turns into this:
#@overlay/match ...
---
#@overlay/replace
foo:
- blah
- bar
this:
#@overlay/match ...
---
foo: []
turns into this:
#@overlay/match ...
---
#@overlay/replace
foo:
- blah
- bar
annotations inside:
#@overlay/match ...
---
foo:
- foo: bar
#@overlay/replace
blah:
#@overlay/match by=overlay.subset("new-item")
- new-item
breaking change: [] empty array
#@overlay/match by=...
---
#@ domains = []
app_domains:
#@ for x in domains:
- #@ "foo." + x
#@ end
#@overlay/match by=...
---
#@ domains = []
app_domains:
#@ for x in domains:
#@ if domain.size > 20
#@overlay/append
- #@ "foo." + x
#@ end
#@ end
cant tell overlay action without knowing all inputs to determine what array items will be inside an array.
#@overlay/match by=...
---
app_domains: []
#@overlay/match by=...
---
app_domains:
#@overlay/append
- foo.domain.com
#@overlay/match by=...
---
#@overlay/replace
app_domains:
- foo.domain.com
#@overlay/match by=...
---
app_domains:
#@ if data.values.blah:
#@overlay/append
- barbaz
#@overlay/match by=...
---
app_domains:
#@ if/end data.values.blah:
- barbaz
#@overlay/match by=...
---
#@ if/end data.values.blah:
app_domains:
- barbaz
app_domains:
#@overlay/match ...
- foo
what is default #@overlay/match by=overlay.index(-1)
- bar
```