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}"
}
}
}
[
{
"lastName": "McClure",
"firstName": "Bert"
},
{
"lastName": "O'Keefe",
"firstName": "Leonarda"
},
{
"firstName": "Wilson"
},
{
"lastName": "Zieme",
"firstName": "Stacey"
},
{
"lastName": "Donnelly"
}
]
Specification
JSON schema
{
"type": "object",
"properties": {
"object": {
"type": "object",
"minProperties": 1
}
},
"required": [
"object"
]
}