Quesion about line 77 of posts.js

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}?

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.

1 Like

From here

We can see that upvoters is an array