Skip to main content

group_by_key

Function group_by_key 

Source
pub fn group_by_key(
    children: Vec<Value>,
    foreign_column: &str,
) -> HashMap<String, Vec<Value>>
Expand description

Group child rows by the value of one of their columns.

The join is done in SQL and the rows come back flat; this puts each child under the parent it belongs to. Keyed by the rendered value, so a parent with no children gets no entry rather than an empty one.