I have this structure in mongoDB and I want to remove all "Vespertino" elements using PHP:
{"_id": ObjectId("5a186d574b23328df3be"),"monday": [
"Vespertino",
"Matutino"],"tuesday": [
"Test1",
"Matutino"],"wednesday": [
"Vespertino",
"Test2"],"thursday": ["Test3","Matutino"],"friday": ["Vespertino","Matutino"],"saturday": ["Matutino"],"sunday": [],"id":"30334798","c_code": "my_company"}
I was trying to get results in first place and then remove the element but I get only null results, this was my attempt until now:
$query_shifts = array('c_code'=>"my_company","wednesday.Vespertino"=> array('$exists' => true));