Skip to main content

attach_to_parent

Function attach_to_parent 

Source
pub fn attach_to_parent(
    parent: &mut Value,
    field_name: &str,
    plan: &EmbedPlan,
    grouped: &HashMap<String, Vec<Value>>,
)
Expand description

Attach grouped children onto a parent row under field_name.

A to-one relationship yields the first match or null; a to-many yields an array, empty when there are no matches, so the shape of the response does not depend on whether data happens to exist.