append.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. [[append-processor]]
  2. === Append processor
  3. ++++
  4. <titleabbrev>Append</titleabbrev>
  5. ++++
  6. Appends one or more values to an existing array if the field already exists and it is an array.
  7. Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar.
  8. Creates an array containing the provided values if the field doesn't exist.
  9. Accepts a single value or an array of values.
  10. [[append-options]]
  11. .Append Options
  12. [options="header"]
  13. |======
  14. | Name | Required | Default | Description
  15. | `field` | yes | - | The field to be appended to. Supports <<accessing-template-fields,template snippets>>.
  16. | `value` | yes | - | The value to be appended. Supports <<accessing-template-fields,template snippets>>.
  17. | `allow_duplicates` | no | true | If `false`, the processor does not append
  18. values already present in the field.
  19. include::common-options.asciidoc[]
  20. |======
  21. [source,js]
  22. --------------------------------------------------
  23. {
  24. "append": {
  25. "field": "tags",
  26. "value": ["production", "{{app}}", "{{owner}}"]
  27. }
  28. }
  29. --------------------------------------------------
  30. // NOTCONSOLE