Skip to main content

Transformation functions

someKeys

Commentary

added in 0.0.5

Selects one or more keys from an object at random. Most useful combined with previousEvent to model an old event with some randomly added changes.


Examples

Selecting subsets of keys

{
"_gen": "someKeys",
"object": {
"firstName": {
"_gen": "string",
"expr": "#{Name.firstName}"
},
"lastName": {
"_gen": "string",
"expr": "#{Name.lastName}"
}
}
}
[
{
"firstName": "Arnita"
},
{
"firstName": "Cierra",
"lastName": "Mitchell"
},
{
"firstName": "Viola",
"lastName": "Gulgowski"
},
{
"lastName": "Swaniawski",
"firstName": "Simona"
},
{
"firstName": "Aline",
"lastName": "Jenkins"
}
]

Specification

JSON schema

{
"type": "object",
"properties": {
"object": {
"type": "object",
"minProperties": 1
}
},
"required": [
"object"
]
}