I am currently trying to find if an array of strings contains a certain string. So far, what I have is:
Following.find({ username: username }, { following: { $in: [profileUsername] } }).exec((err, result) => {
if (err) {
console.log(err);
res.json(err);
} else {
res.json(result);
}
});
However, it says that $in expects two arguments. Is there any better way to check whether the array contains the string? Thanks