Skip to main content
Moves data from one location in the entity to another. The original key is removed after the move.

Fields

Pattern

Required. The dot-notated source path of the data to move. Use * to match all items in an array. Each * becomes a numbered capture group that can be referenced in the replacement as $1, $2, etc.
  • product.name — moves a single value.
  • products.*.name — moves the name of every product; $1 holds the array index.
  • products.*.categories.* — two wildcards; $1 is the product index, $2 is the category index.

Replacement

Required. The dot-notated destination path where the data is written. Use $1, $2, etc. to reference capture groups from * in the source pattern.
  • product_name — fixed destination.
  • product_names.$1 — writes each moved value to its own index.

Conditions

Optional. Only move the data when a condition is met.

Sample data

Pattern: product.name Replacement: product_name Input:
{
    "product": {
        "name": "example"
    }
}
Output:
{
    "product_name": "example"
}

Pattern: products.*.name Replacement: product_names.$1 Input:
{
    "products": [
        { "name": "example" },
        { "name": "example2" }
    ]
}
Output:
{
    "product_names": [
        "example",
        "example2"
    ]
}

Pattern: products.*.categories.* Replacement: categories.$2 Input:
{
    "products": [
        {
            "name": "example",
            "categories": [1, 2, 3]
        }
    ]
}
Output:
{
    "products": [
        {
            "name": "example",
            "categories": []
        }
    ],
    "categories": [1, 2, 3]
}