$map
The `$map` operator applies an expression to each item in an array and returns an array with the applied results.
Syntax
{
$map: {
input: "<array>",
as: "<string>",
in: "<expression>"
}
}
Parameters
input
stringrequiredAn expression that resolves to an array.
as
stringrequiredA string that specifies the variable name for each element in the input array.
in
stringrequiredAn expression that is applied to each element in the input array.