Hi I'm using Parse Javascript API.
I was trying to save user objects as pointer of user array.
But result is
[{"__type":"Pointer","className":"_User","objectId":"a85SoYwEiE"}]
Could you advising me?
Here's my code
if (mentions.length > 0) {
var query = new Parse.Query(Parse.User);
query.containedIn("username", mentions);
query.find().then(function(users) {
// each of results will only have the selected fields available.
var MensionNoti = Parse.Object.extend("Notification");
var mentionNoti = new MensionNoti();
//set by as CurrentUser
mentionNoti.set("notiBy", commentBy);
for (var i = 0; i < users.length; i++) {
// This does not require a network access.
//var user = users[i];
var userPointer = Parse.User.createWithoutData(users[i].id) ;
mentionNoti.addUnique("notiArray", userPointer);
}
//mentionNoti.set("notiArray", users);
mentionNoti.set("type", "mention");
//set Comment
mentionNoti.set("messageText", comments);
mentionNoti.set("checked", false);
mentionNoti.set("postObj", results);
mentionNoti.save();
});
}
Try this. I haven't tested the code but technically, it should work.
Hope this helps :)