{
"group": "Shaping records",
"entries": [
{
"name": "Selected fields",
"sentence": "Keep only the selected fields of each record, in the same record order.",
"query": "collection(${collection}) | { ${fields} }",
"change": "Change ${collection} to the quoted collection name and ${fields} to space-separated field names; use nested braces to select inside an object.",
"defaults": {
"collection": "\"patients\"",
"fields": "name ward"
}
},
{
"name": "Selected collection fields",
"sentence": "Read one collection and cut its records before they reach the worker.",
"query": "{ ${collection} { ${fields} } }",
"change": "Change ${collection} to the bare collection root and ${fields} to space-separated field names.",
"defaults": {
"collection": "patients",
"fields": "name ward"
}
},
{
"name": "Selected fields from two collections",
"sentence": "Read selected patients, then wards, cutting each record to its root's fields.",
"query": "{ ${collection}(ward: ${ward}) { ${fields} } ${other_collection} { ${other_fields} } }",
"change": "Choose ${collection}, ${ward} and ${fields}, then ${other_collection} and ${other_fields}; root order is stream order.",
"defaults": {
"collection": "patients",
"ward": "\"3A\"",
"fields": "name",
"other_collection": "wards",
"other_fields": "code"
}
}
]
}