Setting props for a nested object

Hey,

Imagine we are building a comments feature for our restaurant app.
We have a comments data table with a one to one relation with both User and Restaurant. Now we want to display a list of comments for a particular restaurant. We want it to contain user’s name and avatar and the comment content.

https://api.backendless.com/v1/data/Comments?loadRelations=user&where=restaurant.objectId='someId' and user.objectId='someOtherId'

Everything works well however we are downloading a lot of unnecessary data (whole user profile which can contain a lot of things) for each comment when we need only user.name and user.avatar

Limiting this with props parameter returns “Unable to retrieve data. Query contains invalid object properties.”

https://api.backendless.com/v1/data/Comments?loadRelations=user&where=restaurant.objectId='someId' and user.objectId='someOtherId'&props=user.name,user.avatar

Is there any other way to do this?

Thanks in advance for your support.

Best,
Matt

Hi Matt,

You can retrieve only required fields by setting ‘properties’. You can see example on the REST console in screenshot below.

Cheers, Artur.
http://support.backendless.com/public/attachments/5376663379d338341967c5c63c0778c8.png</img>

Hey Artur,

I know that. I’m asking if this can be done for a nested object.

Best,
Matt

Not at the moment. The discussion is open, though. We will notify you on any progress.

Does “discussion is open” means it’s under development?

No, that means that this is obviously a useful feature and we will set this topic under consideration for our team.

Thanks for clarification.

Assigned tag BKNDLSS-12258