I'm trying to remove some embedded documents from history. I'm using mongodb 3.2 There are two conditions:
- "name" must be for example sa
- "history" "start" must be greater some date
{
"name" : "sa",
"history" : [
{
"start" : ISODate("2015-11-11T12:46:32.000Z"),
"value" : "color1"
},
{
"start" : ISODate("2015-11-12T11:54:20.000Z"),
"value" : "color2"
}]
}
{
"name" : "sa",
"history" : [
{
"start" : ISODate("2015-11-11T12:46:32.000Z"),
"value" : "color1"
},
]
"start" : ISODate("2015-11-12T11:54:20.000Z"),
"value" : "color2"
}]
}
{
"name" : "so",
"history" : [
{
"start" : ISODate("2015-11-11T12:46:32.000Z"),
"value" : "color1"
},
{
"start" : ISODate("2015-11-12T11:54:20.000Z"),
"value" : "color2"
}]
}