I have a MongDB document that looks like this:
{
values: [{val:true}, {val:false}, {val:true}, {val:"dgfdshfsj"}]
}
How would I use the MongoDB $pull operator to remove all elements from the array which are not true
, somewhat like this:
db.myCollection.update({}, {$pull{values:{val:!true}}}, {multi:true})