MongoDB flattening a nested array without unwind
I've been trying to flatten a field of array that occasionally has a nested array when its size is 1 as you can see in example below. (This happened due to a previous error I made with updateMany() while trying…