Here is my code in Node:
The results will always be "No" even if the objects are the same object. i tried with "==" and same answer - "no"
const recipe = await getRecipes(req.params.id); \\ID
let user = await User.findById(req.user._id); \\ user
user.recipes.forEach((item) => {
console.log(item._id); \\ 5f196683308447452cd2c018
console.log(recipe._id); \\ 5f196683308447452cd2c018
if (item._id === recipe._id) {
console.log("yes");
} else {
console.log("no");
}
});
}); ```
"no"and at most one"yes". Are you sure you're not overlooking it?recipe._id- that one would print"yes"in the console. Everything else would print"no". Are you sure you're not just missing the"yes"?