I’m adding a field to an array field like this:
const query = new Parse.Query(UsersPrivateDataTable);
query.equalTo("userID", user.id);
const entry = await query.first({ useMasterKey: true });
entry.add("linkedAddresses", lowerCaseAddress);
try {
await entry.save(null, { useMasterKey:true });
} catch(error) {
throw "Failed to save.";
};
I check the dashboard and the value was added to the array.
However when I try to get that object in the client, every field gets downloaded except that array field (linkedAddresses).
let query = new Parse.Query("UsersPrivateData");
query.equalTo("userID", user.id);
sub = await query.subscribe();
let result = await query.first();
result.get("linkedAddresses"); // RETURNS -> undefined
console.log(JSON.stringify(result)) // Prints all fields except "linkedAddresses"
However, if I add something to that array my sub.on('update')
updates the object and I can see all the array.
Why can’t I access that field with a query? And why does it work with sub.on(‘update’)?