Skip to content

Use Reference objects in HasMany and ManyToMany relations #363

@roxblnfk

Description

@roxblnfk

Hello @roxblnfk does that mean that the only way to create a new record that has a ManyToMany to existing records is to load those existing records and assign them to the ManyToMany property? This would have a pretty severe scalability issue in some cases.

Can you think of a workaround, like exposing a OneToMany relationship to the join table and using references to it when saving/updating a record?

Our API allows a user to give an array of primary keys for many to many relationships, we then would ideally create reference objects for each of these IDs instead of loading them into memory just to create the relationship.

Thanks

Originally posted by @longshadowdev in #338 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions