objectToArray( )


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 objectToArray stage to the aggregation pipeline.

The objectToArray() method adds a pipeline stage that converts an object into an array. Each property becomes an array element containing its key and value, along with all other properties from the original object.

Method Declaration
Copy
Method Parameters
objectFieldNamestring

Key of the object field to convert to an array. Use dot notation to specify nested fields. For example, user.name or product.price.

Learn more about field keys.


destinationFieldNamestring

Key of the new array to create in the result item.

Learn more about field keys.

Returns
Return Type:ObjectToArrayStage
Errors

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

Did this help?