Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

feat(core): one-to-many references #76

Open
plushdohn opened this issue May 17, 2023 · 0 comments
Open

feat(core): one-to-many references #76

plushdohn opened this issue May 17, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@plushdohn
Copy link
Collaborator

plushdohn commented May 17, 2023

The backend for this should be fairly straightforward (the $lookup aggregation operator already returns an array), the frontend is more involved as we need to essentially manage arrays in the forms for the first time.

The API would look something like:

fields: {
  categories: {
    type: "reference",
    collection: "categories",
    many: true
  }
}

The type should then be inferred just as it currently is for reference fields, but as an array. The include property should need no changes.

An appropriate example for this feature would be adding a comment section to our blog example, which would also highlight server actions and collection-level access control.

@plushdohn plushdohn added the enhancement New feature or request label May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant