Expose Projection with a flag incompleteSiblingData !! #1612
geminigeek
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
I could see how this would be useful. My initial thought is it could be a fairly simple change, though there may be some other ramifications. Would it be better to pass the Is this something you would like to make a PR for? I'd like to get other feedback first. We also have a PR to add a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi,
i suggest an option to expose projection for mongoose queries, as payload hooks make use of sibling data we can set another flag "incompleteSiblingData" whenever a projection key is set in the find query, this way hooks logic will know that we do not have all the sibling data.
my use case or where it will be beneficial ?
i have a collection with 60 fields per doc most of the fields are only for internal/admin use and contain very large text , which almost every time i query with payload local api, comes from disk from mongodb server, while the data sent to frontend is all in indexed field, if i run queries with projection natively using req.payload.collections the query runs faster, as less data is pulled from disk and transferred between db and Api server , also no need to post process much before saving to cache layer!
found similar issue #1042
Beta Was this translation helpful? Give feedback.
All reactions