I have a pointer field in my class on my Parse Server. I am trying to use the Javascript API to write the objectId of a linked class field in a Pointer. Here is my function:
$scope.createItem = function (user, product) {
var Item = Parse.Object.extend("II"),newII = new Item();
newII.set("product", product);
var acl = new Parse.ACL();
acl.setPublicReadAccess(false);
acl.setPublicWriteAccess(false);
acl.setReadAccess(Parse.User.current(), true);
acl.setWriteAccess(Parse.User.current(), true);
// This doesn't work
newII.set({
"__type": "Pointer",
"shop": "dklJ4Oaf2B"
});
newII.set("QTY", $scope.qtyCount);
newII.save();
};
The ACL & QTY fields (number) write to the database without issue, however the pointer field (named "shop") doesn't populate.