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

select() constraint is not applied to included objects #1567

Closed
rahilsharma opened this issue Apr 20, 2016 · 9 comments
Closed

select() constraint is not applied to included objects #1567

rahilsharma opened this issue Apr 20, 2016 · 9 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Milestone

Comments

@rahilsharma
Copy link

I am running this same query from parse.com and on my local parse server .

var messageQuery = new Parse.Query("Message");
    messageQuery.descending("updatedAt");
    messageQuery.include("channelId");
    messageQuery.select("channelId");
    messageQuery.select("channelId.exchange");

Channeld is pointer field to my other document.
On parse.com server this query works and return result with only exchange field and on parse-server it selects complete channelId document and prints everything.

@rahilsharma
Copy link
Author

Also select works when i am not expanding any pointer fields.

@hramos
Copy link
Contributor

hramos commented Apr 20, 2016

Can you include more information, such as example responses that clearly show the difference?

Please refer to this issue for an example of a great bug report.

@MasaGon
Copy link

MasaGon commented Jun 17, 2016

I got same issue with Parse Server, when migrating from Parse.com.

This works fine for getting whole sender fields of a message, where sender is Parse.User object.

var messageQuery = new Parse.Query(Message);
messageQuery.descending('createdAt');
messageQuery.limit(1);
messageQuery.include(['sender']);
messageQuery.select(['type', 'body', 'isRead', 'sender']);
return messageQuery.first({useMasterKey: true});

But if I restrict select parameter to 'sender.phone' from 'sender' like this,

var messageQuery = new Parse.Query(Message);
messageQuery.descending('createdAt');
messageQuery.limit(1);
messageQuery.include(['sender']);
messageQuery.select(['type', 'body', 'isRead', 'sender.phone']);
return messageQuery.first({useMasterKey: true});

no sender information is acquired.

parse-server@2.2.13

@Poordeveloper
Copy link

Poordeveloper commented Jul 9, 2016

really a big issue, can only work around on cloud side now.

@Ishimilated
Copy link

I have the same problem. It worked great on parse.com, but not on the parse server.

@hramos
Copy link
Contributor

hramos commented Jul 25, 2016

It seems like the issue is clear at this point: the select() constraint on Parse Server only works for fields on the top level object. It seems like there's interest in replicating parse.com's select() behavior on Parse Server. If someone wants to send a PR to add this enhancement to Parse Server we can take a look.

@hramos hramos changed the title Issue with select query on parse-server select() constraint is not applied to included objects Jul 25, 2016
@flovilmart flovilmart added type:bug Impaired feature or lacking behavior that is likely assumed good-first-pr and removed troubleshooting labels Jul 26, 2016
@ossamaweb
Copy link

+1

flovilmart added a commit that referenced this issue Sep 19, 2016
@flovilmart flovilmart added this to the 2.2.22 milestone Sep 19, 2016
flovilmart added a commit that referenced this issue Sep 24, 2016
* Reproduction for #1567

* Recursive handling of nested pointer keys in select

* Better support for multi-level nested keys

* Adds support for selecting columns natively (mongo)

* Support for postgres column selections

* Filter-out empty keys for pg
@dbloembe
Copy link

dbloembe commented Aug 8, 2018

I'm still having trouble with this same issue. Was this ever addressed?

@flovilmart
Copy link
Contributor

@dbloembe please open a new issue with all relevant informations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

8 participants