Ionic+ - nested queries how to?

Hello All,

I am using as a backend for my app.

I have 2 classes Post and Comment. Comments contain a parent pointer to Post class.

What is the best way to build a query that fetches both Post’s and associated Comments in one call?


Donno how it’s done via Parse but you can respond with nested JSON. That also depends on how you structured the post-comment association (but that’s backend).

On the front-end, just use $http.get ($http)

Yeah if provides such a url-scheme.
If not you have to send multiple request via $http.

I think parse uses mongodb or another documentbased databasesystem?

Then you could build your post schema with their comments.
your Post “class” gets another key “comments” it is an array of objects -> with the keys of your comment “class”.

you do it with Parse Cloud Code - make the query (joining the classes) in the cloud code then use either the REST api or JS sdk to call the cloud code function and it will return your dataset

you should restructure your data model and let parse handle the relationships for you