(feat) Add defaultSelect Option to Collections (similar to defaultPopulate) #13432
Replies: 3 comments
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Related to my question in the Discord:
|
Beta Was this translation helpful? Give feedback.
-
This is a great idea. However, I'm curious about how it would work with I think personally, I'd prefer the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, Payload supports defaultPopulate on collections, which allows defining default population behavior for queries. However, there’s no equivalent for the select property.
Feature Request:
Introduce a defaultSelect option in the collection configuration that works similarly to defaultPopulate, but for field selection. This would allow developers to specify a default set of fields to include (or exclude) when querying a collection, without having to manually pass select in every request.
Use Case:
In our admin panel, we have several calculated fields that depend on joins. While this is fine for an individual item view, it’s inefficient for the overview list (e.g., Orders overview), where we don’t want to query all the joined data.
With defaultSelect, we could:
Beta Was this translation helpful? Give feedback.
All reactions