groups

groups.createByAttribute

createByAttribute(attribute: string, specOverrides?: Partial<GroupSpec>): string[]

Group all nodes by a shared attribute value.

One group is created per unique value of attribute across all nodes. attribute may be "category" (top-level field) or any property key.

Not undoable. Emits "group:created" for each created group.

attributestringNode attribute to bucket on.
specOverridesPartial<GroupSpec>Optional partial GroupSpec applied to every created group (merged after the name is set from the attribute value).

Returns: string[]