Hello,
I am trying to understand how rawUpdate filter works.
I have extended the Users content type to have a property Followers which is a multiple reference to the Users table. I have an array of user ids in my application. What I want is for every user contained in the ids array to update/add my user id to that users Followers array. Is it possible to do so in one query?
Code for reference. It does not match/update anything. If I pass an empty filter my user id is added to my user Followers array:
var followersUsersAttributes = {
"$addToSet": {
"Followers": app.user.Id // my user id
}
};
var followersUsersFilter = new Everlive.Query();
followersUsersFilter.where()
.isin('Id', addToFollowedUsers);
data.rawUpdate(followersUsersAttributes, followersUsersFilter, function (result) {
console.log(JSON.stringify(result));
}, function (err) {
console.log(JSON.stringify(err));
});