Array of mixed types not working correctly
When we have an array of type [String, number], the second item is considered as string and hence, not able to do aggregation like sum.
For example, consider
```
$project: {
transposed: {
$zip: {
inputs: [["aaa","bbb"], [1, 2]]
}
}
}
I am not able to create a data table with transformed.0 in col1 and max(transformed.1) in col2
1
vote
Selvavignesh Vedamanickam
shared this idea
-
AdminTom (Admin, MongoDB) commented
You should be able to use the Convert Type option to convert the array to numbers. Any non-numeric values will be converted to null, and the numeric accumulates should work.