I have classes named _User & Photo & PhotoJourney. I want to send a Photo to a random user based on some action. In the PhotoJourney class I have a field photo (Pointer to Photo class) and photoSentTo (Pointer to _User class).
My requirement is to get all users excluding those whose photo has been sent.
var PhotoObj = Parse.Object.extend("Photo");
var photo = new PhotoObj();
photo.id = request.params.photoId;
var Query1 = new Parse.Query("User");
var Query2 = new Parse.Query("PhotoJourney");
Query2.select("photoSentTo");
Query2.equalTo("photoID", photo);
Query1.doesNotMatchKeyInQuery("objectId", "photoSentTo", Query2);
Query1.find({
success: function(results)
{
},
error : function()
{
}
});
If I execute Query2.find(), it gives me the correct result. i.e. a list of users that I want to exclude from _User table, but I am not sure how to do that and which parameters to pass on to doesNotMatchKeyInQuery("","","").
I am quite new to cloud code development. Please correct me if I am doing it wrong.
Thanks in advance.