Working with nested array in aggregate. $unwind VS $concatArrays

when we have to extract data from nested arrays in aggregate pipeline we can use $unwind or $concatArrays( may be grouped) as far as I know. Is $unwind is better than $concatArrays for this kind of task? Is there any standard to follow?

Hello @reshad_hasan, welcome to the MongoDB community forum.

Aggregation query can use $unwind and $concatArrays to work with array fields (scalar or nested objects).

They have different purposes, but are used for working with arrays. First of all, the two are not comparable as to say which is better - they have their use cases. The provided links also have examples showing the usage.