Unwind
Deconstructs an array type field from the input data and output a document for each element of the array.
Last updated
Deconstructs an array type field from the input data and output a document for each element of the array.
Last updated
When you are working with some specific elements of an array type field, Unwind can make you life easier. It contains two parts:
The field you want to unwind: It must be an array or operators that returns an array.
Whether to include an index: This is optional.
For example you have some data looks like above: The log field contains four elements.