ParseReact
ParseReact copied to clipboard
Working with Relations, not relational queries, and Observe
observe: function (_props, _state) {
var self = this;
return {
attendees: self._getAttendees(_props, _state)
};
},
_getAttendees: function (_props, _state) {
var Event = Parse.Object.extend('Event');
var e = new Event({objectId : _props.event.objectId});
var attendeesRelation = new Parse.Relation(e,'attendees');
return attendeesRelation.query();
},
This is how I am getting all of the attendees that are going to an event, it took quite a while to figure this out because it wasn't clear to me that I couldn't chain queries through Parse.Promise.
Is this the correct approach? Is there a better approach that doesnt require me to manually create the relation object?
Having the same problem here, anyone?