parse-community / parse-community/parse-server
fetchWithSelected, fetchWithExcluded
Open
Nobody has claimed this yet.
type:feature
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
Parse.Query has a include, exclude for selecting only some columns.
But there is no feature like that for fetch method
Feature / Enhancement Description
fetchWithSelect, fetchWithExclude can be useful methods for specific column only.
Example Use Case
fetchWithSelected(['name', 'score'], {useMasterKey: true})
fetchWithExcluded(['name', 'score'], {useMasterKey: true})
const getPartnerInfo = async (userId: string) => {
const user = new Parse.User()
user.id = userId
await user.fetchWithExcluded(['sensitiveData', 'phoneNumber'], {useMasterKey: true})
return user
}
Alternatives / Workarounds
Fetch with query:
const getPartnerInfo = async (userId: string) => {
const query = new Parse.Query(Parse.User)
query.equalTo('objectId', userId)
query.exclude(['sensitiveData', 'phoneNumber'])
return query.first({useMasterKey: true})
}
3rd Party References
(none)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Parse.Query fetch, select, and exclude entry points to understand how field selection currently works. Define the behavior of fetchWithSelected and fetchWithExcluded, including their option handling, and verify that fetching an object returns only the requested fields or omits the excluded fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100