Skip to content

Fix #3185 #3186

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

Merged
merged 2 commits into from
Dec 6, 2016
Merged

Fix #3185 #3186

merged 2 commits into from
Dec 6, 2016

Conversation

flovilmart
Copy link
Contributor

@flovilmart flovilmart commented Dec 6, 2016

When using select() (i.e.: keys) with nested keys a.b parse-server doesn't include by default a which make the call fail (unless you have include('a') specified).

This PR addresses that issue and will simplify the behaviour (and code for the clients).

For ex, calling select a.b.c will not include full objects a and a.b but only the necessary path to resolve correctly the keys clause.

Fixes #3185

this.keys.add('updatedAt');
case 'keys': {
const keys = restOptions.keys.split(',').concat(AlwaysSelectedKeys);
this.keys = Array.from(new Set(keys));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

this.keys.add('objectId');
this.keys.add('createdAt');
this.keys.add('updatedAt');
case 'keys': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm. { in case, new one on me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done();
})
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid test.

@flovilmart flovilmart merged commit fb36dfa into master Dec 6, 2016
@flovilmart flovilmart deleted the fix-#3185 branch December 6, 2016 21:28
Jcarlosjunior pushed a commit to back4app/parse-server that referenced this pull request Dec 13, 2016
* Adds tests that reproduce the issue

* Use values from keys to force include when needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

select() with nested keys issue
3 participants