unwind( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Adds an unwind stage to the aggregation pipeline.

The unwind() method adds a pipeline stage that unwinds an array field by creating a new result item for each array element. Each result contains the array element and all other fields from the original item.

Method Declaration
Copy
Method Parameters
arrayFieldNamestring

Key of the array field to unwind. Use dot notation to specify a nested array. For example, user.products or product.colors.

Learn more about field keys.

Returns
Return Type:UnwindStage
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?