I've got a Class Users, which has a relation to a class Containers . I know an Id for the Container object, and i'm trying to figure out if the user has a specific container as a relation.
My code looks like this:
Parse.User.currentAsync().then((myself) => {
// create a relation based on the containers key
var relation = myself.relation('containers');
// generate a query based on that relation
var query = relation.query();
query.equalTo('id', oArgs.container.id);
query.find().then((found) => {
if (found.length > 1) {
deferred.resolve(true);
} else {
deferred.resolve(false);
}
});
});
I always get an empty set of results. Can anyone help me understand why, and explain what the correct way is of matching a specific object within a relation?
Thanks