Developer Docs
API Reference
Development Tools
seeding
Relationship Config
Interfaces
Interface: RelationshipConfig

web


web / lib/seed/relationship-config / RelationshipConfig

Interface: RelationshipConfig

Relationship Configuration System

This file defines the configuration for resolving relationships between collections during the seeding process. It replaces the hardcoded relationship mappings with a flexible, maintainable configuration system.

Properties

field

field: string

The field name in the source collection that contains the relationship value


targetCollection

targetCollection: string

The target collection to search for the related item


searchField

searchField: string

The field in the target collection to search by (e.g., 'name', 'slug')


fallbackSearch?

optional fallbackSearch: string

Optional fallback field to search if primary search fails


required?

optional required: boolean

Whether this relationship is required (will throw error if not found)


transform()?

optional transform: (value) => string

Transform function to apply to search value before lookup

Parameters

value

string

Returns

string