I have the mongoDB subdocument structure like below,
{
"basecampaign" :
[
{
"timestamp" : "2014-07-28 08:09:22",
"latest" : 0,
"campaign" :
[ {
"id" : "1",
"name" : "status camp 1"
} ]
},
{
"timestamp" : "2014-07-29 08:09:22",
"latest" : 0,
"campaign" :
[ {
"id" : "2",
"name" : "status camp 2"
} ]
},
{
"timestamp" : "2014-07-30 08:09:22",
"latest" : 1,
"campaign" :
[ {
"id" : "3",
"name" : "status camp 3"
} ]
}
]
}
I want to remove subdocument using id, I want to remove the block which has id = 3
{
"timestamp" : "2014-07-30 08:09:22",
"latest" : 1,
"campaign" :
[ {
"id" : "3",
"name" : "status camp 3"
} ]
}
how can i acheive this any suggestion ?