Page created: 20 Jan 2022
|
Page updated: 14 Feb 2023
You can transform an existing collection by applying transformations on the input collection's data or by selecting specific data, which results in a new collection containing entirely different data sets.
<Collection>.![<Projection
Expression>]
becomes a new collection.
For the following input data model, the table following the data model describes possible projections.
{
"user": {
"contacts": [
{
"info": "user01@test.com",
"primary": false,
"type": "email"
},
{
"info": 9876512345,
"primary": true,
"type": "phone"
},
{
"info": 9876511111,
"primary": false,
"type": "phone"
}
]
}
}
Projection | Input | Output |
---|---|---|
Transform to a list of contact types only |
|
["email", "phone", "phone"] |
Extract all primary info attributes |
|
[9876512345] |
Extract the primary info attribute as a different object format |
|
[{"primaryContact": 9876512345}] |