Skip to main content

Transformation functions

merge

Commentary​

added in 0.0.5

Merge a set of objects into one. Most useful when combined with the previousEvent function to model an old event with some new attributes.


Examples​

Applying merge​

{
"_gen": "merge",
"objects": [
{
"firstName": {
"_gen": "string",
"expr": "#{Name.firstName}"
},
"lastName": {
"_gen": "string",
"expr": "#{Name.lastName}"
}
},
{
"score": {
"_gen": "uniformDistribution",
"bounds": [
0,
10
],
"decimals": 0
}
}
]
}
[
{
"firstName": "Carson",
"lastName": "Prosacco",
"score": 1
},
{
"firstName": "Lillie",
"lastName": "Turcotte",
"score": 1
},
{
"firstName": "Chana",
"lastName": "Yost",
"score": 0
},
{
"firstName": "Carmelia",
"lastName": "Boyle",
"score": 1
},
{
"firstName": "Brooks",
"lastName": "Koepp",
"score": 0
}
]

Specification​

JSON schema​

{
"type": "object",
"properties": {
"objects": {
"type": "array",
"minItems": 1,
"items": {
"type": "object"
}
}
},
"required": [
"objects"
]
}