Decorator for creating a has-many relationship between models. Sets up a one-to-many relationship where a model has multiple related models.
Factory function that returns the related model constructor
Optional
Optional custom resource name for the relation
A property decorator function
class User { @HasMany(() => Post) posts: Post[];} Copy
class User { @HasMany(() => Post) posts: Post[];}
Decorator for creating a has-many relationship between models. Sets up a one-to-many relationship where a model has multiple related models.