$unwind, Snowflake’s LATERAL FLATTEN, and Spark’s explode().
Stage Category: APPLY (Expands documents)Transformation: N documents → M documents (where M ≥ N, one per array element)
When to Use
When NOT to Use
Parameters
Configuration Examples
How It Works
- For each input document, extracts the array value at the specified
fieldpath - If the value is an array with K elements, produces K output documents
- Each output document preserves all original fields, with the array field replaced by a single element
- Documents with null/empty arrays are either dropped or preserved based on
preserve_null_and_empty - Non-array values are passed through unchanged
Performance
Common Pipeline Patterns
Per-Tag Scoring
Segment-Level Retrieval
Error Handling
Related
- JSON Transform - Restructure document fields without expansion
- Group By - Inverse operation: group documents by field value
- Deduplicate - Remove duplicates after expansion

