ParseReact icon indicating copy to clipboard operation
ParseReact copied to clipboard

Working with Relations, not relational queries, and Observe

Open aaronksaunders opened this issue 10 years ago • 1 comments

    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?

aaronksaunders avatar Aug 08 '15 20:08 aaronksaunders

Having the same problem here, anyone?

fmnxl avatar Nov 24 '15 11:11 fmnxl