How do you unset a value like treatment, likes or disease? I tried
db.myCollection.update({first_name:"QQQ"},{$unset:{"history.treatment":1}});
It finds the match, but it doesn't unset it. What am I doing wrong?
myCollection:
{ first_name: "QQQ",
last_name: "BBBB",
"history" : [
{
"disease" : [
"X",
"Y",
"Z"
],
"treatment" : "No treatment",
"likes" : "french fries"
}
]}