> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moss.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ParentGrouping

[moss v1.6.0](../README)

[moss](../api) / ParentGrouping

# Interface: ParentGrouping

Collapse sibling documents that share a parent id into one result per unit,
assembled in `order_field` order (numeric-aware). Passed to
[`GetDocumentsOptions.group_by`](./GetDocumentsOptions) and
[`QueryOptions.group_by`](./QueryOptions). See
[Exact / Graph Retrieval](../graph-retrieval). *(moss 1.6.0+)*

```python theme={null}
from moss import ParentGrouping

ParentGrouping("article_id", "chunk_index")
```

## Constructor

* **ParentGrouping(parent\_field: str, order\_field: str)**

## Properties

* **parent\_field**: `str` - Metadata field whose value identifies the parent unit (e.g. `"article_id"`).
* **order\_field**: `str` - Metadata field used to order siblings before collapsing (numeric-aware, e.g. `"chunk_index"`).
