Arrays
When applied to arrays, $type matches any inner element that is of the specified type. Without projection this means that the entire array will match if any element has the right type. With projection, the results will include just those elements of the requested type.
WARNING
Data models that associate a field name with different data types within a collection are strongly discouraged.
Without internal consistency complicates application code, and can lead to unnecessary complexity for application developers.
I ended up looping through it all and check them individually, but I think your suggestion would have worked, thanks.
Regarding the warning at the end - that is exactly why I needed to do this, the data part is “incoming” and provider changed format without consultation so I needed a split/cleanupp.