function
Relationship
func Relationship(
name string,
options ...RelationshipOption,
) DefinitionDefine a singular, many, or polymorphic document reference.
Use To for one target, ToAny for polymorphism, and HasMany or ToMany for a list.
Example
field.Relationship(
"authors",
field.To("users"),
field.HasMany(),
field.OnDelete(field.ReferenceDeleteRestrict),
)Related types
RelationshipOptionOptions accepted by Relationship.
DefinitionAn immutable authored field definition.