I have a user object as shown above. I am trying to write a mongoose query that finds the user via the req.user.id and then queries their wishList array for a specific item with the id that matches the req.params.id
Here is my query:
let userWishListItem = await User.find({_id: req.user.id, 'wishList': {_id: req.params.id}})
userWishListItem just gives back the user currently. how can I get back the specific wishList object in their wishList array. Any advice would be great.