public function saveRelation($instance, $types, $options = [])
    {
        $defaults = ['embed' => []];
        $options += $defaults;
        $types = (array) $types;

        $collection = $instance instanceof Document ? [$instance] : $instance;

        $success = true;
        foreach ($collection as $entity) {
            foreach ($types as $type) {
                foreach ($options['embed'] as $relName => $value) {
                    if (!($rel = $this->relation($relName)) || $rel->type() !== $type) {
                        continue;
                    }
                    $success = $success && $rel->save($entity,  $value ? $value + $options : $options);
                }
            }
        }
        return $success;
    }