listing data with aggregate child objects

I have three tables Company and Reviews and users.
I want to get a list of company and the total no of reviews plus the most recent review and the user who gave that review.

please see attached image

review.PNG

Hi Ali,

Here is a doc page that describes most of the calls you need: https://backendless.com/documentation/data/android/data_basic_search.htm
To get a list of companies, you need a simple find() call.
In case each review contains a link or name of a company, you’ll need a find() call with a where clause similar to this in order to get reviews for a Company:
company.name=‘COMPANYNAME’
To get the most recent review, you’ll need a findLast() API call to Reviews table. Then you may load the related user from that Review.

Also this doc page describes different use-cases which I believe will be useful for you: https://backendless.com/documentation/data/android/data_search_and_query.htm

thanks for the response.

I will check them out, what about the count of the total review.

It would be better to save this number in some column separately, but you also can count the Review objects retrieved for concrete Company (example with whereClause above).