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}"
}
}
}
[
{
"lastName": "Boyer",
"firstName": "Janiece"
},
{
"lastName": "Bednar"
},
{
"firstName": "Josiah"
},
{
"firstName": "Lucien",
"lastName": "Graham"
},
{
"firstName": "Lida",
"lastName": "Rutherford"
}
]

Specification

JSON schema

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