loopbackio / loopbackio/loopback-connector-mongodb
fields filter gets applied to elements to include v5.6.0
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 186
- Forks
- 238
- Avg merge
- 2h 49m
- Merged PRs (30d)
- 1
Description
## Steps to reproduce
Model A belongsTo ModelB
Model A has properties id, A, B, C, modelBId
Model B has properties id, A, D, E
Make any query without specifying scope: fields for the included models:
{
fields: ['id', 'A', 'modelB'],
include: ['modelB']
}
## Current Behavior
result is as follows: [{id, A, modelB: {id, A}}]
## Expected Behavior
included models should have all properties: [{id, A, modelB: {id, A, D, E}}]
## Additional information
Bug introduced in latest minor version, mongodb.js:1403
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 at mongodb.js:1403 and reproduce the belongsTo query from the issue using the v5.6.0 behavior. Compare the selected fields on the root model with the included Model B, and confirm that the included model retains all properties when no include-specific fields scope is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100