Reputation: 710
With below code:
var Photo = Parse.Object.extend("Photo");
var query = new Parse.Query(Photo);
query.equalTo("owner", Parse.User.current());
query.limit(1000);
query.descending("takenAt");
query.include("galleries");
query.find({
success: function(results) {
// results has the list of users with a hometown team with a winning record
console.log(results);
res.render("photos", { photos : results,user:Parse.User.current(),nav:req.originalUrl });
},
error: function(error) {
console.log(error);
}
});
I get error: {"code":102,"message":"field galleries cannot be included because it is not a pointer to another object"}
This galleries field is an array of pointers. An example from the data browser: [{"__type":"Pointer","className":"Gallery","objectId":"hXFwm8yrRT"}]
I have found numerous posts saying this should be correct - Why is it not working?
Upvotes: 0
Views: 1278
Reputation: 710
I was looking deep into the data and found that some objects had null values inside the array. Since these null values are indeed not pointers to Parse Objects, the Parse servers apparently reject includes if any requested array of pointer fields contain null values in the array.
Not a very graceful error, and would be nice to have this behavior shown in the documentation.
I hope this helps someone who might have a similar issue in the future.
Upvotes: 1