@cbnsndwch/zero-sources

UnwindOptions interface

Home > @cbnsndwch/zero-contracts > UnwindOptions

UnwindOptions interface

Options for array unwinding operation.

Signature:

interface UnwindOptions<T = Dict>

Properties

Property

Modifiers

Type

Description

includeArrayIndex?

string

(Optional) Optional: Include array index in output.

Adds a field with the array element's position (zero-based index). The field name is specified by this option.

path

keyof T

Path to the array field to unwind (e.g., '$members', '$items'). Must start with '$' to indicate a field reference.

preserveNullAndEmptyArrays?

boolean

(Optional) Optional: Preserve documents with null, missing, or empty arrays.

  • true: Output document even if array is null/missing/empty - false: Skip documents without the array (default)

false

How was this page?