Tanzim Chowdhury
Tanzim Chowdhury

Reputation: 3090

Parse Server - select a few fields from included object

Is it possible to use .select(JS) / selectKeys(Android) ONLY on the object which is retrieved via .include()?

For example, Class A has a pointer to class B. When I query for Class A, I want all the contents of Class A and only a few selected fields of Class B. Is it possible?

Upvotes: 2

Views: 1684

Answers (1)

Davi Macêdo
Davi Macêdo

Reputation: 2984

Yes. That's possible. You can do something like this:

const aQuery = new Parse.Query('A');
aQuery.include('pointerToB');
aQuery.select('pointerToB.someFieldOfB');

Upvotes: 6

Related Questions