I have the exact same issue as described in this thread (hence the similar title): Mongoose findOneAndUpdate -- updating an object inside an array of objects
Given t
I think you mismatched id and user field
id
user
Try to change id with user
SavedFoods.findOneAndUpdate( { user: userId, 'list.id': 0 } )