Quesion about line 77 of posts.js


#1

upvoters is an array, why can’t I use the $in operator to detect wether the array contains the userId, such as upvoters: {$in: this.userId}?


#2

I think that update is saying: ‘if the user is not already an upvoter, then do the upvote’. You would use $in for a removeUpvote method.


#3

From here

We can see that upvoters is an array