Skip to content

Instantly share code, notes, and snippets.

@heddn
Created May 24, 2017 15:21
Show Gist options
  • Save heddn/07238c08f1887dc2fc9286e126866ddc to your computer and use it in GitHub Desktop.
Save heddn/07238c08f1887dc2fc9286e126866ddc to your computer and use it in GitHub Desktop.
* The key of the array might to be changed. In this case, the new id property needs to be the key.
* It'd be possible to just add key: "@id" to the iterator process but that
* would require special casing the key property and somehow escape it when
* there is actually a destination called key. Instead, it is moved out of the
* process and key is in the configuration of iterator itself:
* @code
* process:
* filters:
* plugin: iterator
* source: filters
* key: "@id"
* process:
* id:
* plugin: static_map
* @endcode
*
* The process pipeline for key is special in two ways: first, it runs after
* the normal process is done. Because of this, key: "@key" is also valid.
* Second, the pipeline does not start with NULL but the value of the current key.
* This way, the value of key can come from the other properties or the current
* key. For the latter, omit the source from the first plugin in the pipeline
* for key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment