I have the following document structure. I'm trying to remove components from the components array with $pull. I can't work out how to select "mast" or "commsbox" from the following document.
{
"_id" : ObjectId("23456yujbvfdfg"),
"d": 1234567,
"components" : [
[
"mast",
{
"foo":"bar"
}
],
[
"commsbox",
{
"BLARN": "bAAA"
}
]
]
}
I've tried
db.sites.update({components: {$exists: true}, {$pull: { components.mast: {$exists: true} } } }).pretty();
but I'm not able to select the component correctly.