I need to remove a specific object that is nested inside an array of objects.
The following db structure looks like:

I would like to remove one of the teams based on the roomId (to find the specific room) and based on the team approved state. If a team has "approved: false" it needs to be deleted from the array of objects.
I'm using mongoose and came up with the following, but without succes:
Room.update({"roomId": req.params.roomId},
{"$pull": { "teams.approved": false } })
screenshot thats shows the correct roomId:

req.params.roomIdgiving you a bad value,console.log(req.params.roomId)and make sure it has a value