Why aggregation doesn't return exact data in my DB

I’m curious about this statement. When you join the data from another collection it ends up as an array because you may have more than one matching value in the collection you are looking up data from. When you unwind you’re now saying you want to have a separate record for each such array element.

If you just want original documents with joined data inside them, don’t do any $unwind stages and that’s exactly what you will get. If you think you need to use $unwind you’ll have to explain why you think you need it…

Asya