I'm approaching Parse Cloud Code at the moment and to learn i'm checking some basic examples. I have a class named MeetingObject in my parse data base. This class has a field "meetingDateAndTime". I created a background job that check for objects older than the current time and destroy them. I would like the see in the parse Info Log the objectId of the destroyed objects but i can only see the success message, not the log. I tried also using result.objectId. Maybe the "result" variable i'm using is not an Array. What am i doing wrong?
Parse.Cloud.job("deleteOldMeetings", function(request, status) {
var query = new Parse.Query("MeetingObject");
var currentDate = new Date();
query.lessThan("meetingDateAndTime", currentDate);
query.find({
success:function(results) {
for (var i = 0, len = results.length; i < len; i++) {
var result = results[i];
console.log("Destroyed object.objectId: "+result.get("objectId"));
result.destroy({});
}
status.success("Success.");
},
error: function(error) {
status.error("Uh oh, something went wrong.");
console.log("Failed!");
}
})
});