Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fields filter gets applied to elements to include v5.6.0 #648

Open
mCassanoNsi opened this issue Oct 19, 2021 · 2 comments
Open

fields filter gets applied to elements to include v5.6.0 #648

mCassanoNsi opened this issue Oct 19, 2021 · 2 comments
Labels
bug v5.x Affects v5.x v6.x Affects v6.x

Comments

@mCassanoNsi
Copy link

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

mCassanoNsi referenced this issue Oct 19, 2021
Signed-off by: Sergey Nosenko <[email protected]>
Signed-off-by: Rifa Achrinza <[email protected]>
@achrinza achrinza added v5.x Affects v5.x v6.x Affects v6.x labels Oct 20, 2021
@achrinza
Copy link
Member

Thanks for opening a bug report, @mCassanoNsi! Seems like you've managed to identify the root cause of the issue; Would you like to submit a PR for review?

@mCassanoNsi
Copy link
Author

mCassanoNsi commented Oct 28, 2021

Hello, I can certainly fix the bug and submit a PR. I wanted to add a non-regression test for this specific case, but I've noticed that all tests about the include parameter are on loopback-datasource-juggler, and none would catch this error. Should I add one anyway to the connector suite?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v5.x Affects v5.x v6.x Affects v6.x
Projects
None yet
Development

No branches or pull requests

2 participants