Parse.com Swift Multiple Class Query -


i'm using parse.com store user information struggling figure following out.

with parse.com have 3 classes:

1) user

2) place

3) savedplace

savedplace class associates user place user saved. each place in savedplace, there user , place pointer additional notes created user.

in app, want retrieve list of user's saved places tableview place info (i.e. name, location, image) , notes.

my current method is:

1) query savedplace saved places , return array of place objectids

2) lookup each objectid in place class , return place information.

is there more efficient way can query parse once of user's saved places , return relevant information place class?

thanks

there is.

pfquery has method called includekey:, allows add objects returned query, in case, want users , places related savedplace instances, right? this:

let query = savedplace.query() query.includekey("place") query.includekey("user") query.findobjects... 

the result list of savedplace objects pointer user , place, objects have been fetched, fields (that aren't pointers) available you.

you can use dot notation method, if have pointer in place class called country , want fetch well, can add query.includekey("place.country") , included in query.

the best thing count single call.

here's more information includekey

http://blog.parse.com/announcements/queries-for-relational-data/


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -