Reputation: 29
I'm trying to remove some embedded documents from history. I'm using mongodb 3.2 There are two conditions:
{
"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"
}]
}
Upvotes: 0
Views: 31
Reputation: 29
I couldn't do it directly. I download the collection and then do the operations that I need, remove the old collection and then insert the new collection with the data that I need.
Upvotes: 0